how to get java 8 for debian 8.10? (openjdk-8-jre)

March 7, 2019 1.2k views
Java Debian

I followed this guide How To Install Java with Apt-Get on Debian 8 and it specifically said that this will install OpenJDK 8, the latest and recommended version.

But I get java 7 instead.

apt list --installed | grep jdk

openjdk-7-jre/oldstable,now 7u181-2.6.14-2~deb8u1 amd64 [installed,automatic]
openjdk-7-jre-headless/oldstable,now 7u181-2.6.14-2~deb8u1 amd64 [installed,automatic]

I can neither use apt-get --config java because I only have one version installed.

I looked in /etc/apt/sources.list and found that digitalocean have used their own mirrors by default, so I changed it to the default ones from debian and did apt update, but still no java 8 package available.

I would appreciate some solution to get java 8, thanks!

1 Answer

Hey friend,

You may want to go over the tutorial again. I just set up a Debian 8 droplet and followed the tutorial. Java 8 was installed as a result:

root@debian-s-4vcpu-8gb-sfo2-01:~# dpkg --list | grep -i jdk
ii  default-jdk                    2:1.7-52                           amd64        Standard Java or Java compatible Development Kit
ii  openjdk-7-jdk:amd64            7u181-2.6.14-2~deb8u1              amd64        OpenJDK Development Kit (JDK)
ii  openjdk-7-jre:amd64            7u181-2.6.14-2~deb8u1              amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless:amd64   7u181-2.6.14-2~deb8u1              amd64        OpenJDK Java runtime, using Hotspot JIT (headless)
ii  oracle-java8-installer         8u201-1~webupd8~1                  all          Oracle Java(TM) Development Kit (JDK) 8
ii  oracle-java8-set-default       8u201-1~webupd8~1                  all          Set Oracle JDK 8 as default Java

The tutorial is for Oracle JDK though at that stage (default version of OpenJDK or Oracle for 8/9), not OpenJDK. If it is necessary that OpenJDK be installed over the Oracle one, you may need to install it by hand or use a newer version of Debian that may have it bundled.


  • Thanks for responding!

    I am pretty sure the tutorial is not only for Oracle’s Java, but has a part that describes how to get their version of java. The default instructions should get you “the default” Java, which I presume is openjdk, and version 8 at that. But maybe this tutorial is old and does not reflect current packages.

    I will try to get Oracle’s Java 8 later.

Have another answer? Share your knowledge.