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

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 10.

Install Oracle Java 10 (JDK 10) in Debian


Oracle Java 10 Debian

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

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

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
exit

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
exit

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.

No comments:

Powered by Blogger.