javaeclipsejava-native-interfaceexternal-tools

Using javah -jni with an Eclipse project structure


I need to know if I'm doing the things in a wrong way.

I have the following project structure (a pretty standard one):

alt text

then I've configured javah as external tool like this:

alt text

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?


Solution

  • 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}