http://blogforopensource.blogspot.tw/2012/08/jni-sample-java-code.html
notes:
15'5/5 :
- javah is used for JNI header
- pay attention to the c compile. It may need extra compiler like VC++
contents:
Blogging after a long time..
JNI - Java Native Interface.
Java interface to nonJava code.
It is Java's link to the "outside world"
• Native methods are compiled into a dynamic link
library (.dll, .so, etc.)
• OS loads and links the library into the process
that is running the Java Virtual Machine
• Part of the Java Developer Kit(JDK),
serves as a glue between Java side and
native side of an application
• Allows Java code that runs inside a Java Virtual
Machine (JVM) to inter operate with applications and
libraries written in other programming languages,
such as C, C++, and assembly
JNI w.r.t Operating System :
JNI Sequence:
If you are really interested in JNI,
You can find a Sample Code from here.
http://code.google.com/p/onlineexaminationsysteminjava/downloads/detail?name=samplejnicode.zip&can=2&q=
Reference:
http://patriot.net/~tvalesky/jninative.html
JNI - Java Native Interface.
Java interface to nonJava code.
It is Java's link to the "outside world"
• Native methods are compiled into a dynamic link
library (.dll, .so, etc.)
• OS loads and links the library into the process
that is running the Java Virtual Machine
• Part of the Java Developer Kit(JDK),
serves as a glue between Java side and
native side of an application
• Allows Java code that runs inside a Java Virtual
Machine (JVM) to inter operate with applications and
libraries written in other programming languages,
such as C, C++, and assembly
JNI w.r.t Operating System :
JNI Sequence:
If you are really interested in JNI,
You can find a Sample Code from here.
http://code.google.com/p/onlineexaminationsysteminjava/downloads/detail?name=samplejnicode.zip&can=2&q=
Reference:
http://patriot.net/~tvalesky/jninative.html
notes:
Add a comment
-----------------------------------------------------------------------------------
Native Method example using JNI
Standard Java compile
Generates .h files. Here is the code.