How to install oracle java 7 in ubuntu 13.04/12.10/12.04

Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.

Preparing your system

First you need to remove openjdk for this run the following command from your terminal

sudo apt-get purge openjdk*

If you installed java 7 from any other PPA and you are having problem with java then you have to do following steps before installing the PPA menctioned here

sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update

Install oracle java 7 in ubuntu 13.04/12.10/12.04

Open the terminal and run the following commands

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

You can check the java version by searching java in dashboard

Sponsored Link

Incoming search terms:

Related posts

83 thoughts on “How to install oracle java 7 in ubuntu 13.04/12.10/12.04

  1. Just great! the only answer, i’ve finally found to this problem…opensource java does not work…thanks


  2. This worked but I would recommend using the Ubuntu Software Center rather than purging file and applications.


    Alexander Reply:

    USC uses just the same commands.


  3. Fun watching the terminal get the job done.. when java8 comes out do you just change the linecommand from 7 to 8?


  4. Man, I love you 😀 I’ve been trying to install java with the instructions on ubuntu wiki, with official instructions on, but nothing helped… This did!
    I don’t know who you are, I don’t know where you are, but I will find you and I will thank you :)

    (btw Ubuntu 13.04 here, works like a charm)


  5. nice nice nice!! Many thanks! Last time I tried installing oracle java it was a real pain in the *ss. Worked like a charm, very clean!!! <3


  6. Thank you guys! The oracle java has been installed successfully even i had troubles with my own applications. But in result i have got the real $JAVA_HOME which points to real JAVA. Ubuntu is great now with such improvement. Serious app can be installed now in moment.


  7. Great tut!
    Been looking for a straight forward install for ubuntu, and this was exacly that, and the most simple.

    Thanks alot mate!


  8. This process apparently installs the 32-bit version of Java. Any instructions on how to install the 64-bit version? (because the 32-bit version won’t run on 64-bit Ubuntu 13.04). Thanks


  9. Works fine up until the point:
    “sudo apt-get install oracle-java7-installer”

    Just get the error message
    E: Unable to locate package oracle-java7-installer

    Did I mess something up?


    C Reply:

    Same here. What is the problem that is causing this?


  10. Hi,

    Just download the netbeans and jdk bundle from Oracle. It will install everything for you..


  11. The only problem with this approach since 2013 is that Java release a massive 100Mb+ update every few weeks via an incredibly slow repo at

    It can take up to 20 minutes to down the 100Mb using a 120Mbps connection. It often times out and you have to start again.

    I don’t know why Java have changed their working practices – probably weak security, but so many big and slow updates is unprofessional.


  12. thanks, this is so simple compared to some of the other instructions out there. worked on 4 machines. thanks again!


  13. getting this error…new to ubuntu please guide

    Proxy request sent, awaiting response… 403 Forbidden file type or location
    2014-03-07 18:48:46 ERROR 403: Forbidden file type or location.

    download failed
    Oracle JDK 7 is NOT installed.
    dpkg: error processing oracle-java7-installer (–configure):
    subprocess installed post-installation script returned error exit status 1
    Setting up gsfonts-x11 (0.22) …
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    Cosmoflop Reply:

    Have you installed Java 7 from the Ubuntu Software Center?


Leave a comment

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