问题描述
所以我试图在Eclipse中的一个编译的.class文件上运行'javah'工具,但是我不知道该怎么做。我发现的例子简单地说出了一些在你的类上运行javah的方式,但是我并不知道在Eclipse中找到这样一个命令行的位置。
So I'm trying to run the 'javah' tool on a compiled .class file in Eclipse, but I have no idea how to do it. The examples I found simply said something along the lines of 'run javah on your class...' but I don't really know where I'd find such a command line in Eclipse.
如果有人可以给我一套白痴证明指示,在Eclipse中完成这个任务,我将不胜感激。
If someone can give me a set of idiot proof instructions get this done in Eclipse, I'd be grateful.
感谢:)
推荐答案
AFAIK Eclipse不会默认集成javah。您必须自己设置为外部工具。
AFAIK Eclipse does not integrate javah by default. You have to set it up as external tool yourself.
- 创建新的外部工具
- 设置路径到javah(在linux上这个
是/ user / bin / javah) - 将工作目录设置为
$ {project_loc} / bin / / code>其中bin是您的Projects输出目录
- 将
$ {java_type_name}
添加到参数
- Create a new external tool
- Set the path to javah (on linux thiswas /user/bin/javah)
- Set the working dir to
${project_loc}/bin/
where bin is your Projects output directory - Add
${java_type_name}
to the arguments
使用此设置,您可以在Package Explorer中的任何java文件上调用javah作为外部工具。
生成的头文件目前位于bin目录中,可以通过添加-d选项来更改。
With this setup you can call javah as external tool on any java file in the Package explorer.The generated header files currently land in the bin dir, this can be changed by adding the -d option.
这篇关于如何从Eclipse运行Javah的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!