I would like to send my application as a standalone jar file. The jar file must contain all class files, as well as two shared libraries. One of these shared libraries is written for JNI and is essentially indirect to the other (which is 100% C).
I first tried to run the jar file without libraries, but had them available through the LD_LIBRARY_PATH environment variable. This worked fine.
Then I put the JNI library in the jar file. I read about loading libraries from jar files, copying them first to some temporary directory, and it worked for me (note that the 100% C library was, I suppose, still loaded).
Now I want to put both libraries in a jar, but I donβt understand how I can make sure that both of them will be loaded. Of course, I can copy them to a temporary directory, but when I load the "indirect" one, it always gives me:
java.lang.UnsatisfiedLinkError: / tmp /.../ libindirect.so:/libpure.so: cannot open a shared objects file: there is no such file or directory
I tried to get the JVM to load the "100% C" library first, explicitly calling System.load (...) in its temporary file, but that didn't help. I suspect the system is looking for it when resolving links in libindirect.so, but does not care about loading the JVM.
Can anyone help me on this?
thanks
java jar dll shared-libraries jni
Philippe
source share