PDA

View Full Version : i thought i had java 6 installed, help needed.



DFord425
February 1st, 2009, 07:30 PM
i ran the command
sudo apt-get install sun-java6-jdk sun-java6-jre
and when i run the command java --version, i get this:

dford@DMoney:~$ java --version
java version "1.5.0"
gij (GNU libgcj) version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

How do i get java 6 from sun?

jpietari
February 1st, 2009, 07:48 PM
I think you need to change your default version of java.

http://kulitkulit.wordpress.com/2008/09/15/set-default-java-in-ubuntu/

DFord425
February 2nd, 2009, 05:07 AM
That tutorial is not that clear, i tried running the commands, but they dont work. Is there something else i can do or can someone explain what they are saying in that link a little better?

myrtle1908
February 2nd, 2009, 06:17 AM
That tutorial is not that clear, i tried running the commands, but they dont work. Is there something else i can do or can someone explain what they are saying in that link a little better?

1. check current default java

java -version
This is to see what Java is configured as the default and which version it is.

2. display available java

update-java-alternatives -l
Here you are listing the Java environments you have available/installed.

3. select java from list

sudo update-alternatives --config java
If step two yields more than one Java environment, then here you can choose which one to set as the default. Note: I added 'sudo' and double-minus to '--config'.

DFord425
February 2nd, 2009, 11:41 PM
Thanks for the help. For some reason the first time i tried it the second step didnt work.