Fork me on GitHub

Installing Sun Java JRE on Ubuntu 11.04

Here's the easiest way to install Sun (Oracle) Java JRE on newer versions of Ubuntu (tested on 11.04) without resorting to third party PPAs.

sudo apt-add-repository "deb natty partner"
sudo apt-get update
sudo apt-get install sun-java6-jre

UPDATE: This no longer works as all of the Oracle Java packages are pulled from all of the PPAs. So, you have to install it by downloading the binaries from Oracle directly.

Posted Sat 16 July 2011 by Ivan Dyedov in Linux (Java, Ubuntu, Linux)


  • Avatar
    David 2012-11-15T17:57:50


    The WebUpd8 Oracle Java repository doesn't host any Java files, because that's not allowed by the new Oracle Java license. Instead, the package uses a script which downloads and installs Oracle Java 6.

    As a reminder, the Oracle Java 7 PPA repository does not host any Java files but only an installer that automatically downloads and installs Oracle Java 7, like the flashplugin-installer package for instance.

  • Avatar
    mlissner 2011-08-04T07:59:40

    You also need to run:
    sudo update-alternatives --config java order to set it as the default java version.