I have a Java application that relies on some legacy code written in C, which it accesses via JNI. The native libraries are stored in a sub-directory (actually, there are two sub-dirs: one with 32-bit libraries and one with 64-bit).
In Windows, the following command line form works fine:
java -Djava.library.path=nativelib64 -classpath myapp.jar;jni_lib.jar MyApplication
but the equivalents on AIX and Linux (basically with the semi-colon in the classpath replaced with a colon) are failing with UnsatisfiedLinkErrors - I'm having to resort to setting the LIBPATH or LD_LIBRARY_PATH explicitly before the call, as nothing I've tried setting -Djava.library.path to (e.g. "nativelib64", "./nativelib64", "/full/path/to/myappdir/nativelib64") seems to be working.
Do the UNIX versions of the JVM not support setting the java.library.path property from the command line?
LD_LIBRARY_PATH. See kalblogs.blogspot.co.uk/2009/01/java.html