Create a Simple Java Project as given below
package com.example.helloworld;
public class HelloWorldActivity {
static {
System.loadLibrary("hello-jni");
}
public native String stringFromJNI();
}
Compile it. Say the directory is "D:\Project\J2SE Workspace\HelloWorld\bin\classes", then go to this directory where the package starts for the class file, then give
javah com.example.helloworld.HelloWorldActivity
It will create a JNI class for you with the required functions provided in the Java file.
package com.example.helloworld;
public class HelloWorldActivity {
static {
System.loadLibrary("hello-jni");
}
public native String stringFromJNI();
}
Compile it. Say the directory is "D:\Project\J2SE Workspace\HelloWorld\bin\classes", then go to this directory where the package starts for the class file, then give
javah com.example.helloworld.HelloWorldActivity
It will create a JNI class for you with the required functions provided in the Java file.
No comments:
Post a Comment