JNI的使用
来源:互联网 发布:mac沙盒机制 编辑:程序博客网 时间:2024/06/01 19:05
JNI
1. create java file which call c method
2. generate *.h file from java class file
javap -cp . HelloJNI
3. create so file with gcc/g++ compiler
4. run java with -Djava.library.path=path_to_lib
The native programs:
3.1 Receive the arguments in JNI type (passed over by the Java program).
3.2 For reference JNI type, convert or copy the arguments to local native types, e.g., jstring to a C-string, jintArray to C’s int[], and so on. Primitive JNI types such as jint and jdouble do not need conversion and can be operated directly.
3.3 Perform its operations, in local native type.
3.4 Create the returned object in JNI type, and copy the result into the returned object.
3.5 Return.
jni example
https://www3.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html
jni spec
http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/jniTOC.html
jni tips
developer.android.com/training/articles/perf-jni.html
- JNI的使用(ZT)
- JNI 的使用
- JNI的使用
- 使用j2se的jni
- JNI 的使用
- JNI的简单使用
- JNI的使用
- JNi 的使用
- JNI的使用
- JNI的使用
- jni的学习使用
- jni的使用
- Android JNI的使用
- JNI的使用
- JNI的使用
- jni的使用
- jni的简单使用
- JNI的一些使用
- typedef定义数组指针操作一维数组
- VirtualBox增强包安装,设置共享文件夹(fedora和win7)
- CAN总线之一
- hdu5253 连接的管道 最小生成树水题
- 欢迎使用CSDN-markdown编辑器
- JNI的使用
- GCD Again HDU杭电1787
- 剪贴板和全局内存块
- firefox os及ubuntu日常使用
- java使用JDBC连接数据库的几种方式
- 通过程序将Visio文档 转换为html网页
- POJ 1006
- 命令模式
- [推荐算法]基于用户的协同过滤算法