I have the following JNI shared library located in /data/subv/Mem, I have set the LD_LIBRARY_PATH to :
LD_LIBRARY_PATH=/data/subv/Mem
which contains two files: bmemBridgelib.so and memBridgelib.so, generated using:
gcc -I"/usr/lib/jvm/java-6-sun/include" -I"/usr/lib/jvm/java-6-sun/include/linux" -o
libmemBridgelib.so -shared -Wl,-soname,libmemBridge.so JniBridge.c -static -lc -fPIC
I load the library in my Java program to use JNI as follows
static {
System.loadLibrary("memBridgelib");
}
but get the following error:
Caused by: java.lang.UnsatisfiedLinkError: no memBridgelib in java.library.path
When i print the library path, i can confirm that the mem folder isn’t in it:
/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
Any ideas? All the other related questions seem to be solved by setting the LD_LIBRARY_PATH
Thanks
More details.