I am using Eclipse to generate a JNI header file. I looked in program files\java\jre6\bin
and found a lot of .exe and .dll files, but I couldn't find the command javah
which was in the documentation for using JNI to create bindings to C libraries.
Any help?
-
Check this out: http://stackoverflow.com/questions/10483959/javah-error-android-app-activity-not-found/25989225#25989225 – Punith K Sep 23 '14 at 07:36
3 Answers
Use the following panel to define a new external tool for javah.exe.
Point "Location" to the javah.exe tool.
Set "Working Directory" to
${workspace_loc:/${project_name}/bin}
Set "Arguments" to:
-classpath ${project_classpath} -v -d ${workspace_loc:/${project_name}/src} ${java_type_name}
To run the tool, highlight the java source file in package explorer and run the tool.
Press F5 to refresh th project to see the newly generated file.
-
1can you please explain the arguments... that will be really helpful... thanks – Amit Jul 04 '12 at 11:43
-
1Click the "Variables.." button. The description for each is listed there. – Java42 Jul 04 '12 at 15:06
Just some info...
Unfortunately the solution above did not work out for me, but the solution in this thread did:
Using javah -jni with an Eclipse project structure
With the above mentioned arguments, I got:
Exception in thread "main" java.lang.IllegalArgumentException:
Not a valid class name:path/to/project
I found out, that the problem was a space character in the path to my project. Wrapping the paths in quotes did help for the solution above.

- 16,027
- 12
- 69
- 122

- 753
- 8
- 19
Location
// javah.exe path
C:\Program Files\Java\jdk1.7.0_79\bin\javah.exe
Working Directory
${workspace_loc:/${project_name}/bin}
Arguments
-classpath ${project_classpath} -v -d ${workspace_loc:/${project_name}/jni} ${java_type_name}
open java class and run tools

- 101
- 1
- 1