添加java.library.path并生效

添加java.library.path并生效

	String lib = System.getProperty("java.library.path");
	lib = "mylibDir;" + lib;
	System.setProperty("java.library.path", lib);
	Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
	fieldSysPath.setAccessible(true);
	fieldSysPath.set(null, null);
	System.loadLibrary("mylib");

你可能感兴趣的:(Java)