How I can set java.library.path in applet using Maven? Usually we can set it by passing parameters to JVM: -Djava.library.path=path/path2. But how I can cause applet to load native libs from java.library.path specified by me?
P.S. I use 3rd-party Java lib, which uses native .dll. So I think it useless to try preload native lib using System.loadLibrary(relativePath); (because 3rd-party lib in any case retry to load .dll from java.library.path and then throw UnsatisfiedLinkError)
How I can set
java.library.pathin applet using Maven?
AFIAU it is not necessary to specify a path so long as the native is on the run-time class-path of the app. Putting it into the root of a Jar referenced as a nativelib in the JNLP should do that.
You can set the java.library.path for Maven this way as this is something you set when the program is run, not when it is built.
For an applet the PATH for windows or LD_LIBRARY_PATH must be set correctly before the browser starts.
Otherwise you need to use the absolute path and search for the DLL or SO yourself.
BTW: You may have security problems trying to use a shared library from an applet.
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