Using javah -jni with an Eclipse project structure

Deadly 提交于 2019-12-07 13:13:23

问题


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?


回答1:


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}


来源:https://stackoverflow.com/questions/4168033/using-javah-jni-with-an-eclipse-project-structure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!