I'm trying to use a native C++ library in Java.
When I'm loading it with
System.loadLibrary(filename);
I get the error:
java.lang.UnsatisfiedLinkError: Directory separator should not appear in library name: C:\HelloWorld.dll
Any ideas how I can solve this?
Just use:
System.loadLibrary("HelloWorld"); // without c:\ and without ".dll" extension
Also, make sure HelloWorld.dll is available on your library path.
loadLibrary needs the filename without the path and the extension.
If you wanna use the full path, you can try the System.load() method.
See java.lang.System API.
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