This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Loading library with absolute path
- From: Lars Andersen <lars at rimfaxe dot com>
- To: java at gcc dot gnu dot org
- Date: 16 Mar 2003 14:36:24 +0100
- Subject: Re: Loading library with absolute path
- References: <1047813176.2675.14.camel@lars.rimfaxe.com>
On Sun, 2003-03-16 at 12:12, Lars Andersen wrote:
>
> Using the GCC-20030310 snapshot on linux.
>
> I'm trying to load a library using Runtime.load(String filename);
>
> This should load the library pointed to by filename :
>
> Runtime.load("/home/lars/projects/rws/libservlets.so");
>
> However i get an UnsatifiedLinkException :
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError:
> /home/lars/projects/rws/libservlets.so:
> libgcj.so.4: cannot open shared object file: No such file or directory
> at java.lang.Runtime._load(java.lang.String, boolean)
> (/home/lars/projects/gcc/libjava/gcj/cni.h:64)
> at java.lang.Runtime.load(java.lang.String)
> (/home/lars/projects/gcc/libjava/java/lang/Runtime.java:624)
>
> , and yes, I'm sure that the file exists.
>
> I have also tried adding the directory to LD_LIBRARY_PATH and running :
>
> Runtime.load("libservlets.so");
>
> with the same result.
>
>
> /Lars Andersen
OK, found out myself : there was a -static in the compile, preventing it
from loading libs.
Lesson learned ;-)
/Lars Andersen