This section follow below process step by step.
Begin by writing the Java program.
Create a Java class that declares the native method; this class contains the declaration or signature for the native method. It also includes a main method which calls the native method.
Generate a header file for the native method
Using javah with the native interface flag -jni
. Once you've
generated the header file you have the formal signature for your
native method.
Reference: