简单的JNI使用,helloworld(存档)

摘要: 1、首先是java文件 Test.java,可以看到我们要调用的c函数就是hello这个方法。 其次 loadLibrary("hello"),表示会找 libhello.so这个库文件。class Test{ native void hello(); static { System.loadLibrary("hello"); } public static void main(String[] args) { Test t = new Test(); t.hello(); }}2、使用 javac Test.java ... 阅读全文
posted @ 2012-09-22 21:03 cnzhwh 阅读(103) 评论(0) 推荐(0)