How to create a C header file using Javah?

Pankaj D. Gaurshettiwar picture Pankaj D. Gaurshettiwar · Jun 11, 2010 · Viewed 9.5k times · Source

I am using android ndk, and for that I am trying to create a c header file using the javah tool. How to use and where to use this tool? I am unable to understand.

Answer

Donal Rafferty picture Donal Rafferty · Jun 11, 2010

Javah should be in the bin folder of your JDK

Something like this:

C:\Program Files\Java\jdk1.6.0_19\bin

For simplicities sake take the path name folder from the bin directory in your Android project and place it in the above directory.

Then use the command prompt

javah -jni com.pathname.ClassName

And the header file will be created in the JDK bin folder