Installing Oracle Java in Ubuntu via PPA 8

The java 8 is yet to come, but we can already test it, and ubuntu is even simpler to install it.

This only supports Ubuntu PPA 13:04, 12:10, 12:04, 11:10, 11:04, 10:10 and 10:04 as well as distributions corresponding to Linux Mint.

Just use the following commands, and ready.

sudo add-apt-repository ppa: webupd8team/java
sudo apt-get update
sudo apt-get install oracle-installer-java8

Verifying Installation

To verify the installation and the current version of Java on your machine, simply run:

java-version

Who is poor and does not use ubuntu , you can use the link: download java

Changing between versions of java

Another thing, very cool, is switch between versions of java , that way you can test the java8 and subsequently switch between versions.

Just open the terminal and use the following command to list the "java" available on the machine.

update-java-alternatives-l

The return should be something similar to:

java-1.6.0-openjdk-i386 1061 /usr/lib/jvm/java-1.6.0-openjdk-i386
java-1.7.0-openjdk-i386 1051 /usr/lib/jvm/java-1.7.0-openjdk-i386
java-7-oracle 1062 /usr/lib/jvm/java-7-oracle
java oracle-8-1063 /usr/lib/jvm/java-8-oracle

And use the first words of each command to return the exchange of packets.

update-java-alternatives-s java-7-oracle
Written by vinicius