For some reason, I'm getting a pesky Unsatisfied Link Error in my java app.
This is the offender in question:
System.loadLibrary("psjw");
Despite the library psjw.dll clearly being in the same source package as this class.
Please help.
The System. loadLibrary() takes as parameter a library name, locates a native library that corresponds to that name, and loads the native library. For information about how a native library is located by the System.
Make sure the psjw.dll is either on your PATH or java.library.path.
Ex: psjw.dll may be in /usr/lib then your command would be java -Djava.library.path=/usr/lib ur.package.UrClass
Test your setup using a stripped down class:
public class TestLoadLibrary {
public static void main(String[] args) {
String libPath = System.getProperty("java.library.path");
System.out.println("java.library.path=" + libPath);
String libraryName = "psjw";
System.out.println("Trying to load '" + libraryName + "'");
System.loadLibrary(libraryName);
}
}
Try to set explicity the library path when starting the JVM: -Djava.library.path="Directory of DLL"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With