我正在尝试在 android-studio 中为 NDK 生成 .h 文件
I am trying to generate .h file in android-studio for NDK
任何人都可以找出此命令中的问题所在。
我使用的生成命令是:
-classpath $Classpath$ -v -jni $FileClass$
它抛出异常:
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);
}
NDK 设置:
@Alex Cohn 帮我解决了这个问题,正确答案是:
-classpath "$Classpath$" -v -jni $FileClass$
任何人都可以找出此命令中的问题所在。
我使用的生成命令是:
-classpath $Classpath$ -v -jni $FileClass$
它抛出异常:
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);
}
NDK 设置:
@Alex Cohn 帮我解决了这个问题,正确答案是:
-classpath "$Classpath$" -v -jni $FileClass$