System.loadLibrary()是在使用Java的JNI机制时,会用到的一个非常重要的函数,它的作用即是把实现native方法的那个链接库load进来,或者load其他什么动态连接库。 System.loadLib()的实现(code在libcore/luni/src/main/java/java/lang/System.java这个文件中): /** * Loads and links the library with the specified name. The mapping of the * specified library name to the full path for loading the library is * implementation-dependent. * * @param libName * the name of the library to load. * @throws UnsatisfiedLinkError * if the library could no<span style="color:#003399;"></span>t be loaded. */ public static void loadLibrary(String libName) { Runtime.getRuntime().loadLibrary(libName, VMStack.getCallingClassLoader()); }