This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other JSE/JEE APIs and the fly likes unsatisfiedlinkerror while loading library file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "unsatisfiedlinkerror while loading library file" Watch "unsatisfiedlinkerror while loading library file" New topic

unsatisfiedlinkerror while loading library file

Siddharth Gaur

Joined: Jan 02, 2006
Posts: 1
This is what I am trying to do.
I have a c file, which we are trying to use in java through JNI

Compiling getDBMImpl.c file with
gcc -fPIC -c getDBMImpl.c

creating library file
gcc -shared -o getDBMImpl.o

setting environment variable LD_LIBRARY_PATH to the directory where library file is located.

We are trying to load this library in with underline code.

This is working fine on my system but gives the following error on other system.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no mylib in java.library.path
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.<init>(
at java.lang.Error.<init>(
at java.lang.LinkageError.<init>(
at java.lang.UnsatisfiedLinkError.<init>(
at java.lang.ClassLoader.loadLibrary(Compiled Code)
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at <Unloaded Method>

I also tried following two options but no use.

1 Setting java.library.path
2 System.load("/home/gaurs2/trunk"); (giving absolute path of the shared object)

I am compiling and making library files on my system and copying them on the other as there is no compiler on that system.

Thanks in advance
wood burning stoves
subject: unsatisfiedlinkerror while loading library file