How to Install Oracle Java JDK 6/7/8 on Ubuntu 13.04 / 12.10 / 12.04

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

Share and Enjoy

  • Twitter
  • Facebook
  • Google Plus
  • Email
  • RSS
Tagged with: , , , , , , , , ,
Posted in The Linux and Unix Articles!
20 comments on “How to Install Oracle Java JDK 6/7/8 on Ubuntu 13.04 / 12.10 / 12.04
  1. Carlo Savignano says:

    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

  2. RTJ says:

    good post.
    Thanks for the info.

  3. Kevin says:

    How are future java updates handled when using this method to install java?

  4. Andrew says:

    Thanks for the guide. You should also run:

    sudo apt-get install oracle-java8-set-default

  5. Lothinator says:

    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…

    • Mark says:

      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.

  6. vimukthi says:

    thnkz for help

  7. Sanchixx says:

    I love you!!!!!

  8. Erin Hodgess says:

    Great guide! Thanks so much

  9. debuger says:

    Very good post. Thanks a loot. I’m terrible angry with install JDK on 13.04 before find this article.

  10. Hendo says:

    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.

  11. Simo says:

    Very good post. Thanks so much

  12. Roberto Marin says:

    Excelent work!

  13. mascot says:

    Very helpfull, big thx !!

  14. aeternam says:

    Thnx for tutorial!

  15. prashasth baliga b says:

    really good one :) thanks a lot :) good job :)

  16. dora says:

    thanks, this was really helpfull, very good tutorial, worked for me on ubuntu 13.10 .

  17. suresh says:

    thanks for this tutorial

  18. Eduardo says:

    gracias!!!!!!!!!!!!!!!!!!!!!!!!!

6 Pings/Trackbacks for "How to Install Oracle Java JDK 6/7/8 on Ubuntu 13.04 / 12.10 / 12.04"
  1. [...] So this is all I have right now for you all. I will be continuing my studies on other IDEs also one of which is my favorite Eclipse. But unfortunately I moved away from it as its JavaScript support was freakishly annoying and kept on encountering errors now and then. But is one of the best for PHP and Java as I have seen. But recently there is new versions of plugins for NodeJs in Eclipse too but I have to go through it in details to confirm its usability. One more is the Netbeans which is also a very famous and Popular IDE for Java devels as well as PHP. But I personnaly do not like its UI and fonts much in Ubuntu or any other Debian distros so I am doing some studies for its font support too. It seems that installing Oracle’s Java instead of OpenJDK(Default JVM for Ubuntu and most of Linux Distros) fixes this problem to a lot but not completely. So for Netbeans fans you can always have the Oracle Java installed by following these simple steps. But please don’t install the Version 8. Its in development stage and pretty unstable condition. http://linuxg.net/how-to-install-oracle-java-jdk-678-on-ubuntu-13-04-12-10-12-04/. [...]

  2. [...] Ref : http://linuxg.net/how-to-install-oracle-java-jdk-678-on-ubuntu-13-04-12-10-12-04/ [...]

  3. [...] java dependent: To run java applications, you need to have OpenJDK or Oracle Java. See how to install Oracle Java here, and OpenJDK here.          if you have make the soures [...]

  4. […] & simple article to install Oracle JDK on […]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!