I'm new to JNI. I see there are several ways to set JVM to look for libraries dll, so, etc.
System.setProperty("java.library.path", ".");
System.loadLibrary("hello");
That's when
UnsatisfiedLinkError
java.lang.UnsatisfiedLinkError: no hello in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at HelloWorld.main(HelloWorld.java:17)
But if I comment the line that sets the
java.library.path and call the program with the command
java -Djava.library.path=. HelloWorld works.
The question is: Why is not working? How should it be the property setup? I rather don't set Variables, or use -D option.
Thanks in advance.
PD: If it helps I'm using JDK 1.5.0_01 on Linux kernel 2.6.8