将 javah -jni 与 Eclipse 项目结构结合使用
我需要知道我是否以错误的方式做事。
我有以下项目结构(一个非常标准的结构):
然后我配置了 javah 作为外部工具,如下所示:
当我在 OSManager4Windows.java
我本来希望在 bin/it/univpm/quickbackup/utils/
中找到 it_univpm_quickbackup_utils_OSManager4Windows.h
,但它在 bin
内。这是正确的吗?不应该位于 .class 文件的同一目录中吗?
I need to know if I'm doing the things in a wrong way.
I have the following project structure (a pretty standard one):
then I've configured javah
as external tool like this:
When I run the external tool on OSManager4Windows.java
I was expecting to find it_univpm_quickbackup_utils_OSManager4Windows.h
in bin/it/univpm/quickbackup/utils/
but it is inside bin
. Is that correct? Shouldn't be inside the same directory of the .class file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是 javah 在执行命令的目录(您指定的 bin 文件夹)上生成头文件。在同一个文件夹中生成所有标头是有意义的,因为通常 c/c++ 项目将所有标头放在同一个文件夹中。
但是,如果您需要特定文件夹,以下命令会在特定 src 文件夹中生成标头。
The problem is that javah generates the header file on the directory that the command was executaded (which you specified the bin folder). It makes sense to generate all headers in the same folder because usually c/c++ project put all of headers in the same folder.
However, if you want specific folders, the following command generate the headers in the specific src folder.