This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Loading library with absolute path


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]