Using javah on linux

吃可爱长大的小学妹 提交于 2019-12-01 20:26:13

You don't go to src folder of the project, but the root of your compiled .class files (where com subfolder exists or is created). javah is looking for compiled class, not your source file. If you just run javac manually, the class file will be in the same location as the original sources. Then the statement "go to src folder" is correct. However if you have a project in Eclipse or you use ant or something, the classes might be in completely different location - depending on how your project is set up. I would guess that the Eclipse projects on your Windows and on your Linux are set up differently.

You don't have to use javah on the class files. You can use javah directly on the source files (.java) to generate the native C/++ signature (header) file. Ex:

javah -cp /Users/Android/android-sdk/platforms/android-xy/android.jar;. com.test.JniTest
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!