Ubuntu / Linux news and application reviews.

Update: Java 7 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 7 installer in this article will continue to work only if you manually download Oracle JDK 7 (version 7u80 for 32bit and 64bit or 7u60 for arm), place it in the /var/cache/oracle-jdk7-installer/ folder on your computer, then install "oracle-java7-installer" as explained below in this article.

---------------------------------------------------------------------------

A quick tip for Debian users who want to install and stay up to date with the latest Oracle Java 7 (JDK7): the WebUpd8 Java 7 PPA works on Debian too since the package is just an installer and all you have to do is manually add the PPA repository to the Software Sources.

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.

Update: our Oracle Java 7 installer now supports ARM. Oracle Java 7 supports ARM v6/v7 Hard Float and Soft Float ABI.

For Oracle Java 8, see: How To Install Oracle Java 8 In Debian Via Repository [JDK8]


Install Oracle Java 7 (JDK7 and JRE7) in Debian


To add the WebUpd8 Oracle Java PPA repository to the Software Sources in Debian (tested on Debian Squeeze, but it should work with any Debian version), use the following commands:
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer
exit

Tip: if you're behind a firewall / router that blocks some of the redirects required to download the Oracle Java archive, you can download the JDK tar.gz archive manually and place it under /var/cache/oracle-jdk7-installer - then, installing the "oracle-java7-installer" package will use the local archive instead of trying it to download it itself.

Crunchbang users: it seems Crunchbang has an old Oracle Java 7 Installer in its repositories and because it uses a higher priority, trying to install the package from our PPA doesn't work and instead you get the old version from Crunchbang (7u7). To force the installation of the latest version, use the following command (example for Oracle JDK 7u76, replace "7u76" with the latest JDK version):
apt-get install oracle-java7-installer=7u76-0~webupd8~1
Alternatively, you can give the WebUpd8 Java PPA a priority higher than 1001.

oracle java 7 debian

oracle java 7 debian

And that's it, Oracle Java 7 (both JDK7 and JRE7) should now be installed and you should receive automatic updates with future Oracle Java 7 versions, under Debian.

Update: the installer now requires you accept the Oracle license before the installation begins. This is only required once. If for some reason you need the installation to be automated, you can run the following command to automatically accept the Oracle license:
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections


Setting Java environment variables


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

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


For installing Oracle Java 7 in Ubuntu, see: Install Oracle Java 7 in Ubuntu via PPA Repository