Loading a dll which is packed within the Jar file
Hello
I have a jar file called mht.jar and it has a dll called mydll.dll - all packed together using ant.
So, when i do:
java -cp %CLASSPATH%.;mht.jar com.test.MHTTest
I get: Native code library failed to load.
java.lang.UnsatisfiedLinkError: no mydll in java.library.path
This is because i have:
try{
System.loadLibrary("mydll");
}catch (UnsatisfiedLinkError e){
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
The program works if i place the mydll.dll file in the working directory. It seems as if it cannot extract and read the dll from within the jar file. How do i do this?
Any help will be much appreciated.
Thanks
pJ

