Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Studio javah不是有效的类名_Android_Java Native Interface - Fatal编程技术网

Android Studio javah不是有效的类名

Android Studio javah不是有效的类名,android,java-native-interface,Android,Java Native Interface,我正在写一本书“Chapter-3-communication-with-Native-Code-Using-JNI.pdf”。当我尝试使用javah命令创建头文件时,出现了以下错误: Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: ?classpath 我试过终端的指令: javah –classpath bin/classes com.example.hellojn

我正在写一本书“Chapter-3-communication-with-Native-Code-Using-JNI.pdf”。当我尝试使用javah命令创建头文件时,出现了以下错误:

Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: ?classpath
我试过终端的指令:

javah –classpath bin/classes com.example.hellojni.HelloJni
但我看到这是针对Eclipse路径的,我使用的是Android Studio。所以我试了一下:

..helloJni\app>javah -d jni –classpath build\intermediates\classes\arm7\debug com.example.hellojni.HelloJni

我在“HelloJni\app\build\intermediates\classes\arm7\debug\com\example\HelloJni”中有HelloJni.class文件。我仍然得到同样的错误,我很惊讶,我无法找到一个直接解决stackoverflow。你能帮我一下吗?

你从什么地方复制了
-classpath
参数了吗?您的错误消息表明
javah
认为
-classpath
是类名。正如它在输出中显示的那样,
?类路径
,似乎
-
不是您所认为的,而是一些特殊的字符。试着自己键入
-classpath

编辑:我很好奇。代替
-
的是&ndash