Steps involved:
- Create your java class & declare the method to be called using JNI with the native keyword.
- Compile the java program (javac FileName.java)
- Create the C or C++ header (javah -jni FileName) , FileName.h is generated by the machine.
- Write your C or C++ program and include the above generated header file.
- Create the shared object file (.so) (gcc -path_where_jdk_is_located/jdk1.6/include -path_where_jdk_is_located/jdk1.6/include/linux FileName.c -shared -o filename.so)
No comments:
Post a Comment