By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

Installing Oracle Java on Ubuntu

Tutorial on how to easily install Oracle Java from a terminal in Ubuntu.

Edited: 2014-06-12 17:10

Some programs require Oracle Java to run, and might not work properly with OpenJDK. As of the writing of this, Aptana Studio does not support OpenJDK, and as such using it anyway may lead to instability.

To check which version of Java you are currently using, type java -version into a terminal and hit enter, doing this should output something like:

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

Installing Oracle Java

The easiest way to install Oracle Java is by typing the following commands in a terminal window:

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

Typing this will install Oracle Java 8 automatically, simply replace the "8" with "7" if you want to install Java 7 instead. I.e.

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

Sources

  1. http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html