在Eclipse项目结构中使用javah -jni [英] Using javah -jni with an Eclipse project structure

查看:104
本文介绍了在Eclipse项目结构中使用javah -jni的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道我是否以错误的方式做事情。



我有以下项目结构(一个非常标准的):





然后我配置了 javah 作为这样的外部工具:





当我在 OSManager4Windows.java 我期待在 bin / it / univpm / quickbackup / utils /中找到 it_univpm_quickbackup_utils_OSManager4Windows.h / code>,但它位于 bin 之内。那是对的吗?不应该在.class文件的同一个目录中?

解决方案

问题是javah生成头文件执行命令的目录(您指定了bin文件夹)。在同一个文件夹中生成所有标题是有意义的,因为通常c / c ++项目将所有标题放在同一个文件夹中。



但是,如果您想要特定的文件夹,以下命令生成特定src文件夹中的标题。

  -d$ {workspace_loc} $ {system_property:file.separator} $ {container_path}$ {java_type_name} 


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?

解决方案

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.

-d "${workspace_loc}${system_property:file.separator}${container_path}" ${java_type_name}

这篇关于在Eclipse项目结构中使用javah -jni的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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