March 21, 2012 · General · Email This Post

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 Comments to “How to install oracle java 7 in ubuntu 13.04/12.10/12.04”

  1. merab says:

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


  2. Jacob Harding says:

    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. Shanmukh says:

    Thanks a lot for the post. It worked for me!.


  4. Michael says:

    Thank you very much, I love you bro!!!!! lmao


  5. karthikeyan says:

    Thank you so much !!! may the force be with you !


  6. Felipe Duarte says:

    Great, this tutorial is very good because was helped me a lot.


  7. G says:

    thanks for the help :) works on BT like this also


  8. Alison says:

    Fantastic, thanks! Works on Ubuntu 11 also.


  9. Flavian says:

    Thank you man. Works on Ubuntu 13.04!


  10. Jim says:

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


  11. Moony says:

    Man, I love you :-D 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)


  12. The_Doodle says:

    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


  13. LukCAD says:

    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.


  14. Flatus says:

    How to install Java 64-bit?


  15. Mohammed says:

    Thank you very much. This is only guide that works.


  16. Rune Pedersen says:

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

    Thanks alot mate!


  17. David T says:

    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


  18. S says:

    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?


  19. Aubrey Bourke says:


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


  20. D says:

    Seems to work in 13.10 Saucy Salamander as well, just installed it on the final beta.


  21. Eddie says:

    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.


  22. sa says:

    Good stuff. installed java7 in a flash


  23. Tina Bornaman says:

    It 100% works thanks


  24. chuckie says:

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


  25. meenakshi says:

    Thanks it worked.


  26. Mohd Farid says:

    Very useful. Worked as expected without any hiccups at all.

    Thanks a lot for sharing.


  27. _darth_vaider_ says:

    hangs at okay…. …. …. ….ect for a long time is this normal?


  28. Smriti says:

    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?


  29. Coca says:

    Thanks you for this helpful instruction


  30. elite facebook says:

    works greate thanks.


Leave a Reply