If you really need to use Oracle (ex Sun) Java instead of OpenJDK in Ubuntu, here's a PPA repository to install and keep your computer up to date with the latest Oracle Java 7 JDK (which includes JRE).
Oracle JDK7 itself is not hosted in the PPA because that's not allowed by the new Java license. The package in the PPA automatically downloads and installs Oracle Java JDK 7 from its official website and installs it on your computer, just like the flashplugin-installer package does. It supports Ubuntu 12.04, 11.10, 11.04 and 10.04.
1.To add PPA use the commands below:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-jdk7-installer oracle-java7-set-default
2.After the installation finishes, if you wish to see if it was successful, you can run the following command:
java -version
It should return something like this:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)
3.If for some reason, the Java version in use is not 1.7.0, run the following command:
sudo update-java-alternatives -s java-7-oracle
Run step 2 & check again.
Oracle JDK7 itself is not hosted in the PPA because that's not allowed by the new Java license. The package in the PPA automatically downloads and installs Oracle Java JDK 7 from its official website and installs it on your computer, just like the flashplugin-installer package does. It supports Ubuntu 12.04, 11.10, 11.04 and 10.04.
1.To add PPA use the commands below:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-jdk7-installer oracle-java7-set-default
2.After the installation finishes, if you wish to see if it was successful, you can run the following command:
java -version
It should return something like this:
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)
3.If for some reason, the Java version in use is not 1.7.0, run the following command:
sudo update-java-alternatives -s java-7-oracle