Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javah

Status
Not open for further replies.

grindstonegirl

Technical User
Jun 12, 2003
29
0
0
US
Hi
this is going to be a silly question, but i am trying to write a java program with native methods. I am following the tutorial at java sun and it says to use the javah utilty to make the header file. To do this it says to run from the command line with the arguements:

javah -jni FileName

the problem is that it's not recognizing javah. i get an error: The name specified is not recognized as an interal or external command. It has to be the javah cause i know i'm in the right folder and the file is there. Do i need to download something extra to get javah to work? or am i missing something really obvious?
thanks
~grindStone~
 
java, javac and javah are all in the ...\jdk...\bin directory, so if java and javac can be found, javah should also. [ Check whether javah.exe is in the bin directory (or somewhere else). Set your path to include the bin directory. ]
 
Hi
i searched for javah and javac i have neither one. i do have java.exe is there anyway to get these files?
~grindStone~
 
They are included with any jdk version. Just download the SDK from How can you compile *.java source-files if you do not have the "javac"ompiler ? I guess you just looked in the jre directory (which only contains java, not javac or javah). Just search again.
 
I'll download it. I have been using eclipse as my IDE. So i don't know why I dont have these files, I searched all local hard drives for the javac and javah. all i could find was java.exe and javaw.exe but thanks for you help
 
ok so downloaded the SDK from java sun now when i try to use javah.exe i am getting the error: java.lang.NoClassDefError: com/sun/tools/javah/main

from teh error it appears as though the problem is with the javah file. my file has no problem running when i run it through eclipse but running it through with javah gives the above error. any idea why?
 
Eclipse does not come with a full JDK. It uses the in-process Java compiler instead of the JDK (I think you can change this for another one, haven't tried).

Who or what generates the NoClassDefFoundError?
Are you trying to run it from a Java frontend? If so you may need to add your J2SDK/bin directory to the classpath of the application.
 
I actually figured it out. I didn't know that about eclipse thanks
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top