Menu

#70 Can't find dependent libraries on Windows

open
nobody
Files (8)
5
2013-05-08
2013-05-08
r007
No

I'm trying to build a one-jar with a jni interface to a native library.
(My build process packages both using maven-nar-plugin and maven-onejar-plugin, but that should be irrelevant here.)
One-Jar unpacks and System.load's the JNI library apparently just fine, but the JNI dll depends on a native dll (which is also included in the one-jar).
One-Jar also apparently unpacks the native library as `basename ${native_dll} .dll`-${timestamp}.dll.
The load then fails with an "UnsatisfiedLinkError: <JNI dll>: Can't find dependent libraries.".
My guess is that's due to the fact that Windows' loader is looking for the native library under its original name (without timestamp). Microsoft calls this the "module name".
Any Ideas how to fix this? Would it be feasible to, instead of extracting the binlibs with a timestamp in the filename, extracting them into a timestamped directory under the original names?

Discussion


Log in to post a comment.