dcsimg
Unable to find my library under Turbo Linux
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jun_Gao
Posted On:   Sunday, January 27, 2002 07:49 PM

I'm using Turbo Linux server 6.5. I've written a very simple Java program to test how to load library under Linux, my code does have only: System.loadLibrary("pw001"); pw001.so is a library I've created and is put under the directory: /home/bgu/lib Then I compile my java code, and use "java -Djava.library.path=/home/bgu/lib -classpath . XXX" to run my compiled code. But I always got an Exception, said: "Exception in thread "main" java.lang.UnsatisfiedLinkError: no pw001 in java.library.path at java.lang.ClassLoader.loadLibrary ... I am really puzzled how this will happen while I specified the path so clearly.   More>>

I'm using Turbo Linux server 6.5. I've written a very simple Java program to test how to load library under Linux, my code does have only:
System.loadLibrary("pw001");

pw001.so is a library I've created and is put under the directory:
/home/bgu/lib

Then I compile my java code, and use
"java -Djava.library.path=/home/bgu/lib
-classpath . XXX"
to run my compiled code.

But I always got an Exception, said:
"Exception in thread "main" java.lang.UnsatisfiedLinkError: no pw001 in java.library.path
at java.lang.ClassLoader.loadLibrary
...

I am really puzzled how this will happen while I specified the path
so clearly.
Can anybody help me and
tell me how to solve this?

   <<Less

Re: Unable to find my library under Turbo Linux

Posted By:   Jun_Gao  
Posted On:   Monday, January 28, 2002 11:02 PM

If you said "System.loadLibrary("pw001");" in your java code, then
the name for the library should be
"libpw001.so", that's the mapping rule
of library to file name in linux.

Library name -- File name :
XXX -- libXXX.so
About | Sitemap | Contact