PDA

View Full Version : [ubuntu] Jdk 6_18



ganeshmagal
March 4th, 2010, 05:36 AM
Hi,
I am new to Linux.
I am trying to setup Java JDK6_18 on my ubuntu machine. I downloaded the .bin (jdk-6u18-linux-i586.bin) file from the SUN site. I gave permission using 'chmod 777' and installed it using './<filename>.bin' and it did install and created a new folder in the same location as the '.bin' file.
However when I try to do 'java -version' from terminal I can't find it, may be because I have not updated it in the PATH. But the problem is what should I give the path in the path variable.
I tried using the apt command and installed JDK but it is not the latest version.
Thanking you in advance
Ganesh

Sef
March 4th, 2010, 06:32 AM
1) Do you have a 32 or 64 bit os?

2) It is much easier to download java through Ubuntu Software Center. Applications > Ubuntu Software Center > Search > two choices to type in

a) OpenJDK (a must if you have AMD64-bit)

b) Sun java

Either one will work and just click install.

ganeshmagal
March 4th, 2010, 06:37 AM
I have a 32 bit OS. I did try installing it via the Ubuntu Software Center however it doesnt have the latest release of JDK.

BenAshton24
March 4th, 2010, 06:43 AM
You have probably just missed a step somewhere; have a look at the installation instructions: http://www.java.com/en/download/help/linux_install.xml

If you followed them then it should have installed to /usr/java/.

ganeshmagal
March 4th, 2010, 06:52 AM
I did try those steps...but aren't they for browser plugin? I am trying to install JDK. Please correct me if I am wrong.
Thanks

wojox
March 4th, 2010, 07:00 AM
Sun_Java_6 is in the repo's:


sudo apt-get install sun-java6-jdk

BenAshton24
March 4th, 2010, 07:17 AM
Oh, sorry, you're right of course I didn't read your question properly :S

For JDK these are the instructions that you want: http://java.sun.com/javase/6/webnotes/install/jdk/install-linux-self-extracting.html

If you didn't change the directory then it should have installed to the same folder that you were currently in. You can install it wherever you want so long as you set the paths correctly.

ganeshmagal
March 4th, 2010, 07:35 AM
How to set the path. I want to override the newly installed JDK over any other version installed.
Thanks

kotoro
March 5th, 2010, 08:48 PM
Sun_Java_6 is in the repo's:


sudo apt-get install sun-java6-jdk

Of course it is, but its something like version jre-1.6.0_15 unless I misconfigured something.

ganeshmagal
March 5th, 2010, 11:19 PM
Thanks all for the replies.. i downloaded the .bin from SUN and installed the JDK6_18 and then removed the jdk6_15 and automatically the default JDk was selected as 6-18 and now i can build using the latest JDK.
Thanks again
Ganesh