Hello Linux Geeksters.
In this article I will show you how to install the Oracle Java (JDK) 8, Oracle Java (JDK + JRE) 7 or Oracle Java (JDK) 6 on Ubuntu 13.04, Ubuntu 12.10 and Ubuntu 12.04.
The Oracla Java has been removed from the official Ubuntu repositories due to some Java licence issues.
Before you install it, remove OpenJDK, if you have it installed:
$ sudo apt-get purge openjdk*
To install Java 8/7/6, do this:
In order not to get issues with the add-apt-repository command, install the following package:
$ sudo apt-get install software-properties-common
Add the PPA:
$ sudo add-apt-repository ppa:webupd8team/java
Update the repo index:
$ sudo apt-get update
Install Java 8:
$ sudo apt-get install oracle-java8-installer
Or, install Java 7:
$ sudo apt-get install oracle-java7-installer
Or, install Java 6:
$ sudo apt-get install oracle-java6-installer
Hi, first thanks for the guide. second, i would like to notice you of a typo error. The java 6 command should be “oracle-java6-installer” indeed of “oracle-java67-installer”. Thanks for the attention.
Carlo Savignano
good post.
Thanks for the info.
How are future java updates handled when using this method to install java?
very well,just use apt-get update && apt-get install oracle-java{7,8}-installer
Thanks for the guide. You should also run:
sudo apt-get install oracle-java8-set-default
Now this junk tries to force me to install GCJ java instead when I try to remove OpenJDK… Purge actually installs the other. Purge GCJ and it reinstalls OpenJDK… Purge OpenJDK and it reinstalls GCJ…
They are being jerks about this at Ubuntu!!! I don’t care about philosophical issues, I need to use Sun JDK because that’s what works with the tools i’m using. And they’re FORCING me to use something else…
Maybe they’re not being jerks but there’s a dependency issue in Ubuntu that requires at least one JDK?
To be honest, there is no harm in leaving OpenJDK. I installed Oracle JDK alongside with no problems. No need to purge it.
thnkz for help
I love you!!!!!
Great guide! Thanks so much
Very good post. Thanks a loot. I’m terrible angry with install JDK on 13.04 before find this article.
If you get a ‘add-apt-repository command not found’ when trying to add the ppa, then run:
$:~# sudo apt-get install software-properties-common
and all should be good and nice in the world once again.
Very good post. Thanks so much
Excelent work!
Very helpfull, big thx !!
Thnx for tutorial!
really good one 🙂 thanks a lot 🙂 good job 🙂
thanks, this was really helpfull, very good tutorial, worked for me on ubuntu 13.10 .
thanks for this tutorial
gracias!!!!!!!!!!!!!!!!!!!!!!!!!
Installed successfully. Thank for you for the post!