如何在Eclipse中配置javah工具工具、如何在、Eclipse、javah

2023-09-06 06:33:17 作者:超龄儿童.

我已经约5答案发现,尝试了所有的人,并没有得到它的工作。

I found already about 5 answers, tried all of them and didn't get it working.

信封:Ubuntu的12.04 /靛蓝

Env: Ubuntu 12.04/ Indigo

运行 - >外部工具 - >外部工具配置...

Run->External Tools->External Tools Configuration...

创建新计划 地点:在/ usr / bin中/ javah的/ *的 $其中javah的给出的/ usr / bin中/ javah的* /

Created new Program Location: /usr/bin/javah /*$ which javah gives /usr/bin/javah */

工作目录:$ {workspace_loc:/ MyProject的/ bin中/类}

Working directory: ${workspace_loc:/MyProject/bin/classes}

属性:-d $ {workspace_loc:/ MyProject的/ JNI} com.myproject.MyActivity

Attributes: -d ${workspace_loc:/MyProject/jni} com.myproject.MyActivity

运行的结果:找不到类文件com.myproject.MyActivity

Result of RUN: Could not find class file for 'com.myproject.MyActivity'

从终端运行提供了相同的结果 格言@ Ubuntu的:〜/工作区/ MyProject的/ bin中/类$ 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 格言@ Ubuntu的:〜/工作区/ MyProject的/ bin中/类$

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日

移动本地库加载到一个单独的类解决了这个问题。

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 。

Try to read it and see if it helps: Using javah on linux.