So I'm trying to run the 'javah' tool on a compiled .class file in Eclipse, but I have no idea how to do it. The examples I found simply said something along the lines of 'run javah on your class...' but I don't really know where I'd find such a command line in Eclipse.
If someone can give me a set of idiot proof instructions get this done in Ecl开发者_Go百科ipse, I'd be grateful.
Thanks :)
AFAIK Eclipse does not integrate javah by default. You have to set it up as external tool yourself.
- Create a new external tool
- Set the path to javah (on linux this was /user/bin/javah)
- Set the working dir to
${project_loc}/bin/
where bin is your Projects output directory - Add
${java_type_name}
to the arguments
With this setup you can call javah as external tool on any java file in the Package explorer. The generated header files currently land in the bin dir, this can be changed by adding the -d option.
Here is a sample command line:
javah -classpath /path/to/project/classes com.mycompany.MyClass
/path/to/project/classes - This is the 'Output folder' from the Source
tab of Java Build Path
properties page for you project.
It may be relative to the directory from where you are running javah.
You may use -verbose
flag to see more details about what's going on.
精彩评论