View Full Version : Set java Path

22nd June 2008, 01:33 AM
I upgraded to java 6, and for some reason "javac" is not recognized. I try to set the path as the the following :
but I still get javac command not found.

Any ideas. Thanks a lot


22nd June 2008, 02:01 AM
Not sure exactly what you did/where you specified this. Try:
export PATH=$PATH:/usr/java/jdk1.6.0_06/bin/

To make that persistent, edit your ~/.bashrc file and add that folder to the list of PATH:


P.S. This all assumes of course that the files/executables etc. are actually in that location.

P.P.S. Oh, and editing ~/.bashrc won't take effect in any open terminals unless/until you run:
source ~/.bashrc

22nd June 2008, 10:10 AM
What java installation package did you use? That path statement you showed is really wrong as Hlingler mentioned.

Show us:

alternatives --config java

Saint Mike
22nd June 2008, 03:00 PM
try something like

/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.6.0_06/bin/java 50000 (or wherever the directory is)

to add it to the alternative system with a priority of 50000

then as above

alternatives --config java

and set it to that entry

22nd June 2008, 03:39 PM
Hey guys I did you what you said and everything worked afterwards .. Thank a lot for your help, i really appreciated it.

/usr/java/jdk1-6.0/bin/java was getting very old :)...

again thanks,