I keep getting a java.lang.UnsatisfiedLinkError error every time I run my program. I have a native, a wrapper, and the program to call the native through the wrapper.<
If you test with
nativeFile = new File(filename + ".dll");
if (!nativeFile.exists())
System.exit(1);
you should use it !!
System.load(nativeFile);
There are two different ways to load a native library into a running Java program:
System.loadLibrary(String)
and System.load(String)
.
The System.loadLibrary
method allows us to load a library from the "default" path.
System.loadLibrary("HelloWorld");
System.load
allows us to load a library from anywhere via its absolute path.
System.load("c:/path/to/dll/HelloWorld.dll")
;