Hi All,
I'm forced to dynamically load dll libraries into the jvm (can't use -Djava.library.path) and consequently I must use [System.load()|http://java.sun.com/javase/6/docs/api/java/lang/System.html#load(java.lang.String)] .
With reference to the attached code....
* A
java.lang.UnsatisfiedLinkError is thrown by
SomeJNIWrapperClass theInstance = new SomeJNIWrapperClass();.
* The
System.load("C:/path/to/the/nativelib.dll"); does
NOT throw any exception, indicating success! (javadoc: [System.load()|http://java.sun.com/javase/6/docs/api/java/lang/System.html#load(java.lang.String))
* I have the correct and absolute path to the nativelib.dll (this is not the problem).
* Everything works perfectly if I test this with the use of
-Djava.library.path command line argument.
What I am doing wrong here? If anyone can help me out, THANK YOU :)
public class TheTest {
public static void main(String[] args){
try{
System.load("C:/path/to/the/nativelib.dll");
SomeJNIWrapperClass theInstance = new SomeJNIWrapperClass();
} catch (Exception e){
e.printStackTrace();
}
}
}