PDA

View Full Version : how can i set class path in ubuntu?



void_void
January 21st, 2009, 06:28 AM
when i fire following command i get the following result

<JAVA_HOME>/bin/javah -o HelloWorldNative.h -jni -classpath home/jjoshi/NetBeansProjects/HelloWorld/build/classes helloworld.Main
bash: JAVA_HOME: No such file or directory

how can i set class path ?

jespdj
January 21st, 2009, 10:11 AM
Just type "javah", and not "<JAVA_HOME>/bin/javah". Also, use "-classpath /home/..." - note the slash / before "home".

Try this:

javah -o HelloWorldNative.h -jni -classpath /home/jjoshi/NetBeansProjects/HelloWorld/build/classes helloworld.Main

JAVA_HOME is not the same as CLASSPATH. You do not normally have to set either JAVA_HOME or CLASSPATH, but if you really want to, you can add lines like this to your ~/.profile:

export JAVA_HOME=/usr/lib/jvm/java-6-sun
(assuming you're using Sun Java 6). Note, after editing your ~/.profile you have to log out and in.