Ubuntu / Linux news and application reviews.

Update: Java 6 is no longer supported by Oracle. The binaries are no longer available for download, but if you have an Oracle account, you can still download it after logging in. 

The Oracle Java 6 installer in this article will continue to work only if you manually download Oracle JDK 6 (version 6u45), place it in the /var/cache/oracle-jdk6-installer/ folder on your computer, then install "oracle-java6-installer" as explained below in this article.


As you know, we maintain a PPA repository which hosts Oracle Java 7 and 8 installers for Ubuntu and Debian users. WebUpd8 reader Eugene San has modified the package to install Oracle (Sun) Java 6, which is required for Android development, and he has asked us to upload it to our Java PPA.

So you can now install Oracle Java 6 (includes JDK and JRE) in Ubuntu or Debian using the WebUpd8 Java PPA repository.

oracle java 6 ubuntu

The advantage of using our PPA over manually installing Oracle Java 6 is that we provide updates so instead of having to check every now and then to see when a new Java version is released and install it manually, you can simply use our PPA and get automatic updates.

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.

Install Oracle Java 6 in Ubuntu via PPA

The current JDK version in the PPA is Oracle Java SE 6 Update 38 (7u38).

To add the WebUpd8 Java PPA and install Oracle Java 6, which includes JDK, JRE and the browser plugin in Ubuntu (and other Linux distributions based on Ubuntu such as Linux Mint, etc.), use the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer

Currently, the are packages for Ubuntu Raring, Quantal, Precise, Oneiric, Natty, Maverick and Lucid.

Using the same PPA you can also install Oracle Java 7 or Oracle Java 8.

Install Oracle Java 6 in Debian using our PPA repository

Debian users can add the WebUpd8 Oracle Java repository and install Oracle Java 6 using the commands below:
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java6-installer

Setting Java environment variables

To automatically set up the Java environment variables, you can install the following package:
sudo apt-get install oracle-java6-set-default

If you've already installed oracle-java7-set-default or oracle-java8-set-default, they will be automatically removed when installing oracle-java6-set-default (and the environment variables will be set for Oracle Java 6 instead).