javah 错误

错误:无法访问 com.myproject.FirstNDKProjectActivity
未找到 com.myproject.FirstNDKProjectActivity 的类文件
javadoc: 错误 - 找不到类 com.myproject.FirstNDKProjectActivity。
Error: 未在命令行中指定任何类。请尝试使用 -help。

总有以上错误,尝试下面的方法:
http://stackoverflow.com/questions/9985336/javah-cant-find-class-android-ndk

The ant part of the Android build system actually places the class files in bin/classes. So you need to have $PROJECT_DIRECTORY/bin/classes on the javah classpath. For example, from the src directory you could run:

$PROJECT_DIRECTORY/src$ javah -classpath ../bin/classes bt.nativeclient.BtnativeActivity 

This assumes that you've compiled your Java code to the corresponding class files first. You can check by seeing what is in the bin/classes directory - it should contain the bt directory, which is the top of your package name.

应该这样:

 

~/android_workspace/FirstNDKProject/src$ javah -classpath ../bin/classes/ com.myproject.FirstNDKProjectActivity

生成头文件就在src下面!

OK!

你可能感兴趣的:(javah 错误)