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
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 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) |