I am using Java with Netbeans under Ubuntu. I am working with JNI and want to load the dll where in linux it has the ".so" extension. Why this piece of code is working:
static {
System.load("/home/user/NetBeansProjects/JD2XX-DLL2/dist/jd2xx.so");
}
But this isn't:
static {
System.loadLibrary("jd2xx");
}
with VM Options specified in netbeans to:
-Djava.library.path="/home/user/NetBeansProjects/JD2XX-DLL2/dist/"
I am getting an error:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
no jd2xx.so in java.library.path
This works for me under Windows.
On a Unix system,
System.loadLibrary("Foo");
looks for a file called libFoo.so
in the library search paths.
Rename the file accordingly.
By contrast, on a Windows system that call will look for a file called Foo.dll
in the library search paths.
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