portable statement to load JNI library from a different directory using relative pathname?
问题 Is there a platform-independent Java statement to load a native library from a different directory than the Java source code is in? I would like to use something like this: public class HelloWorld { static { System.loadLibrary("../some_project/HelloWorld"); } public static native void print(); } The problem is that System.loadLibrary() doesn't support directory separators in the pathname argument. Also, System.load() unfortunately requires an absolute pathname, which not only means I can't