如何在Eclipse中配置javah工具 [英] How to configure javah tool in Eclipse
问题描述
我发现已经有5个答案,尝试了所有的答案,没有得到它的工作。
I found already about 5 answers, tried all of them and didn't get it working.
Env:Ubuntu 12.04 / Indigo
Env: Ubuntu 12.04/ Indigo
运行 - >外部工具 - >外部工具配置...
Run->External Tools->External Tools Configuration...
创建新程序
位置:/ usr / bin / javah / * $ javah给出/ usr / bin / javah * /
工作目录:$ {workspace_loc:/ MyProject / bin / classes }
Working directory: ${workspace_loc:/MyProject/bin/classes}
属性:-d $ {workspace_loc:/ MyProject / jni} com.myproject.MyActivity
Attributes: -d ${workspace_loc:/MyProject/jni} com.myproject.MyActivity
结果的RUN:无法找到'com.myproject.MyActivity'的类文件
Result of RUN: Could not find class file for 'com.myproject.MyActivity'
从终端运行给出相同的结果
maxim @ ubuntu:〜/ workspace / MyProject / bin / classes $ javah -jni com.myproject.MyActivity
Run from terminal gives same result maxim@ubuntu:~/workspace/MyProject/bin/classes$ javah -jni com.myproject.MyActivity
错误:无法访问android.app.Activity
类文件为android.app.Activity不发现
maxim @ ubuntu:〜/ workspace / MyProject / bin / classes $
Error: cannot access android.app.Activity class file for android.app.Activity not found maxim@ubuntu:~/workspace/MyProject/bin/classes$
安装SDK / NDK,添加外部路径。
如何添加缺少的零件?感谢大家。
SDK/NDK installed, external paths added. How to add missing parts? Thanks everybody.
已编辑7月3日
将本机lib加载到单独的类解决问题
Moving native lib loading to a separate class solved the problem
推荐答案
我在linux上也有一个非常类似的问题。原来我没有在正确的文件夹上。
I had a very similar problem on linux too . it turned out that i didn't do it on the right folder.
尝试阅读它,看看它是否有帮助:在linux上使用javah 。
Try to read it and see if it helps: Using javah on linux.
这篇关于如何在Eclipse中配置javah工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!