On a docker container running the latest debian image I'm unable to install the openjdk-8-jdk package. Why not suddenly?

$ apt-get install openjdk-8-jdk
E: Unable to locate package openjdk-8-jdk

Why not, there it is: https://packages.debian.org/stretch/openjdk-8-jdk

Debian version:

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION="10 (buster)"

Searching for openjdk-8-jdk packages:

apt-cache search --names-only '^openjdk-8*'
openjdk-11-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-11-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-11-doc - OpenJDK Development Kit (JDK) documentation
openjdk-11-jdk - OpenJDK Development Kit (JDK)
openjdk-11-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-11-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-11-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-11-jre-zero - Alternative JVM for OpenJDK, using Zero
openjdk-11-source - OpenJDK Development Kit (JDK) source files
openjdk-11-jre-dcevm - Alternative VM for OpenJDK 11 with enhanced class redefinition

3 Answers 3


You are on Debian 10 (buster), but the link you showed is for Debian 9 (stretch).

OpenJDK is on version 11 for Buster and OpenJDK 8 is not available.


If you need this, use a docker image based on Stretch.


Apparently Debian 10 alias Buster only provides openjdk 11 packages.

In my case this meant using debian 9 alias stretch instead. I must admit it wasn't very clever using latest as a version in the first place.


FROM debian:latest


FROM debian:stretch

Debian stretch is a LTS version supported until 06.2022


I know it's not java 8 but java 11 for debian v 10:

sudo apt-get install openjdk-11-jre

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.