Install Oracle Java 10 (JDK 10) In Debian From PPA Repository

Update: Oracle Java 10 has reached the end of public updates (see the roadmap here), therefore it's no longer available for download. As a result, the packages in the Linux Uprising Java PPA no longer work. Switch to Oracle Java 11 (which is in the Linux Uprising PPA and is a long term release), the latest Oracle Java 14, or OpenJDK (you may also use AdoptOpenJDK or ZuluJDK) instead.

For Ubuntu or Linux Mint see our other article: Install Oracle Java 10 In Ubuntu Or Linux Mint From PPA Repository

Like I was telling you in the previous article, I made a PPA for Oracle Java 10 based on the WebUpd8 Java PPA packages (which doesn't include Oracle Java 10). While many PPAs don't work in Debian, this one does because the package downloads and installs official Oracle Java 10 binaries, which, unlike regular PPA packages, aren't built for specific Ubuntu versions.

Oracle provides Java 10 for 64bit only, so the packages from the LinuxUprising Java PPA will only work on 64bit. Do not try to use this on other architectures because it won't work! The PPA repository package will install Oracle Java 10 JDK, which includes JRE. The JRE bin Java folder is no longer separate and is not included in the same bin folder as the JDK binaries.

Install Oracle Java 10 (JDK 10) in Debian

Oracle Java 10 Debian

Using the commands below you'll add the LinuxUprising Java PPA repository to your software sources and install Oracle Java 10 in Debian (any Debian version):

su -
echo "deb bionic main" | tee /etc/apt/sources.list.d/linuxuprising-java.list
apt-key adv --keyserver hkp:// --recv-keys 73C3DB2A
apt-get update
apt-get install oracle-java10-installer

The package name is oracle-java10-installer and not oracle-java10-jdk because it doesn't contain any Oracle Java files. It's just an installer that downloads the binary from Oracle's servers and configures everything automatically for you.

After adding the PPA to your software sources, to make Oracle Java 10 default on your Debian system, make sure oracle-java10-set-default is installed (it may be installed automatically):

su -
apt-get install oracle-java10-set-default

If you want to have Oracle Java 10 installed but not used as the default Java version on your Debian machine, remove the oracle-java10-set-default package:

su -
apt-get remove oracle-java10-set-default

In cases where the installer fails to download the Oracle Java 10 tar.gz archive (the download is blocked by a router, firewall or ISP), you can manually download the Oracle Java 10 tar.gz archive, place it in the /var/cache/oracle-jdk10-installer folder, then install the oracle-java10-installer package and it should pick up the downloaded tar.gz archive instead of downloading it from Oracle's servers.

Accept the Oracle Java 10 license without user input

When installing Oracle Java 10, the user is prompted to accept the Oracle license before proceeding with the installation. If you need to automate the installation (for Docker, scripts, etc.), you can use a command to automatically accept the Oracle license before installing the Oracle Java 10 package:

echo oracle-java10-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections

I've read that the command above doesn't work on some Debian systems, although it worked for me in Debian Testing. If the command above doesn't work on your Debian machine, you can also try the following command instead:

echo oracle-java10-installer shared/accepted-oracle-licence-v1-1 boolean true | sudo /usr/bin/debconf-set-selections

For Ubuntu, Linux Mint, elementary OS and other Ubuntu-based Linux distributions, see: Install Oracle Java 10 In Ubuntu Or Linux Mint From PPA Repository.