我正在尝试创建一个简单的 Android-JNI 示例,但在尝试生成头文件时出现错误。 我正在关注的链接是:
http://www.ntu.edu.sg/home/ehchua/programming/android/android_ndk.html
我在第二步中遇到错误:
javah -classpath ../../bin/classes;<ANDROID_SDK_HOME>\platforms\android-<xx>\android.jar
-o HelloJNI.h com.mytest.JNIActivity
我根据下面提到的用例修改了命令: 错误:
[SimpleJni]#javah -classpath ./bin/classes;/home/xxxxxx/Documents/8.7.14ADT/adt-bundle-linux-x86-20140702/sdk/platforms/android-18/android.jar com.example.simplejni.JNIActivity
Error: no classes specified
bash: /home/xxxxxx/Documents/8.7.14ADT/adt-bundle-linux-x86-20140702/sdk/platforms/android-18/android.jar: cannot execute binary file
我无法理解这个问题。我也检查了 jar 文件的权限,并将其设置为 755。 我还应该做什么?我哪里做错了?任何帮助表示赞赏。 提前致谢。
最佳答案
这应该可行
javah -classpath ../../bin/classes/ -bootclasspath /home/xxxxxx/Android/Sdk/platforms/android-23/android.jar -o HelloJNI.h com.mytest.JNIActivity
关于android - 简单的 JNI 示例 Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26994675/