android-ndkandroid-studio-2.2javah

I am trying to generate .h file in android-studio for NDK


Can anyone figure out whats the issue in this command.

i used command for generating is:

-classpath $Classpath$ -v -jni $FileClass$

it throws exception:

Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: Files\Java\jdk1.8.0_102\jre\lib\charsets.jar;C:\Program
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:129)
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:107)
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:64)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:503)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:329)
at com.sun.tools.javah.Main.main(Main.java:46)

MyNDK.class:

public class MyNDK {

// Used to load the 'native-lib' library on application startup.
static {
    System.loadLibrary("MyLibrary");
}

public native int getHelloSum(int[] val,int size);

}

Setting for NDK: NDK SETTING


Solution

  • @Alex Cohn helped me to fix this the correct answer is :

    -classpath "$Classpath$" -v -jni $FileClass$