Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

Get UnsatisfiedLinkError when using System.LoadLibrary(..)

SOLVED
Go to Solution
Occasional Visitor

Get UnsatisfiedLinkError when using System.LoadLibrary(..)

Hello,

We are using JNI calls to legacy C code from Java on NT4.0 and HP11. Both have java1.2.
When calling System.loadLibrary(ourlib)we get
"UnsatisfiedLinkError no ourlib in java.library.path".
Env. vars: $SHLIB_PATH,$PATH,$LPATH,$LD_LIBRARY_PATH and property java.library.path point to the path where ourlib is.
System.load(absolutepathandlibname)works fine.
This problem exists only on HP, on NT everything is OK.

Any help appreciated,
Thank you in advance,
ILdus
3 REPLIES
Honored Contributor Honored Contributor

Re: Get UnsatisfiedLinkError when using System.LoadLibrary(..)

When you run a JNI application using the Java Virtual Machine in the SDK for
Java 2.x, you must use build 2435 or greater of the Java Virtual Machine. When
you run a JNI application using the Java Virtual Machine in the SDK for Java
3.x, you must use build 3158 or greater of the Java Virtual Machine.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Occasional Visitor

Re: Get UnsatisfiedLinkError when using System.LoadLibrary(..)

We get the following version info on our JVM.

->java -version
java version "1.2.2.04"
HotSpot VM (1.0.1fcs, mixed mode, PA2.0 build 1.2.2.04-00/04/14-PA_RISC2.0)

Is it OK?

Was your note referring to the HotSpot JVM or another one? If you were referring to HotSpot can you tell us how to determine our build number. If you weren't referring to HotSpot do you know the relevant build numbers for HotSpot?

Thanks

Highlighted
Occasional Visitor

Re: Get UnsatisfiedLinkError when using System.LoadLibrary(..)

The problem was solved by adding a word lib to library name.
Before: jawsstand.sl
After: libjawsstand.sl
But the call to loadLibrary should have the name jawsstand:
System.loadLibrary("jawsstand");