10

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_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

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

4 Answers 4

10

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.

https://packages.debian.org/buster/openjdk-11-jdk

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

5

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.

before:

FROM debian:latest

after:

FROM debian:stretch

Debian stretch is a LTS version supported until 06.2022

0

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

sudo apt-get install openjdk-11-jre

0

I had this error while building a Dockerfile. The solution was to install default-jre instead:

sudo apt-get install -y default-jre

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .