I'm running a jar file that unpacks and loads its own native libraries at runtime. It uses a temp folder and a modified java.library.path
to achieve this. Example:
static {
System.loadLibrary("magma");
System.loadLibrary("magmajni");
}
magmajni depends on magma, so I explicitly load magma first. This works great on Windows.
However, on Linux, when it reaches magmajni, it apparently wants to load magma again. Furthermore, when it tries to load it again, it ignores java.library.path
and throws an UnsatisfiedLinkError because it can't find libmagma.so.
The only way I can get it to run is by setting LD_LIBRARY_PATH
before running the jar. I don't like that solution. I don't see why it should be loading magma again when I've already explicitly loaded it.