java调用c++的库 简单的过程如下
class Hello
{
public native void sayHello();
static
{
try
{
System.setProperty("java.library.path",System.getProperty("java.library.path")+ ":/Work/java_study/3");
System.out.println(System.getProperty("java.library.path"));
Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
fieldSysPath.setAccessible(true);
fieldSysPath.set(null, null);
System.loadLibrary("aa");
}catch(Exception e){
}
}
public static void main(String[] args)
{
System.out.println("in main");
new Hello().sayHello();
}
}