Search This Blog

Wednesday, May 02, 2012

How do I install the Sun Java SDK in Ubuntu 11.10 Oneric?

Ubuntu 11.10 Oneric

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin
[Source]

Ubuntu 12.04 Precise

Clean up the historical open jdk:
sudo apt-get purge openjdk*
Add a new repo and install the sdk:
sudo add-apt-repository ppa:eugenesan/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
If you want the JRE and the browser plugin:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
[Source]

Make the sun java the default

You may want to also add the following
sudo update-alternatives --config java
You should get the following
  Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice[*], or type selection number: 2
Select (2) and press enter
Now running:
java -version
Returns:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

No comments:

Post a Comment

Thank you