如何从Eclipse运行Javah [英] How to run Javah from Eclipse

查看:134
本文介绍了如何从Eclipse运行Javah的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图在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.


  1. 创建新的外部工具

  2. 设置路径到javah(在linux上这个
    是/ user / bin / javah)

  3. 将工作目录设置为 $ {project_loc} / bin / / code>其中bin是您的Projects输出目录

  4. $ {java_type_name} 添加到参数

  1. Create a new external tool
  2. Set the path to javah (on linux this was /user/bin/javah)
  3. Set the working dir to ${project_loc}/bin/ where bin is your Projects output directory
  4. 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆