4

I need to install openjdk-8 on a docker container based on the latest python image (debian 10), but the openjdk-8-jdk package has been removed from the stable debian repository. I've already tried the usual apt-get install openjdk-8-jdk and apt-cache search openjdk only returns the openjdk-11.

DavidPostill
  • 162,382

3 Answers3

3

The answer over at SO is nicer:

wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -

sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/

sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot

1

I've managed to solve it by manually downloading the packages with wget:

RUN wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre-headless_8u212-b03-2~deb9u1_amd64.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre_8u212-b03-2~deb9u1_amd64.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk-headless_8u212-b03-2~deb9u1_amd64.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk_8u212-b03-2~deb9u1_amd64.deb

and then install it using the dkpg with the -i --force-all options to install all the required dependencies:

RUN dpkg -i --force-all openjdk-8-jre-headless_8u212-b03-2~deb9u1_amd64.deb openjdk-8-jre_8u212-b03-2~deb9u1_amd64.deb openjdk-8-jdk-headless_8u212-b03-2~deb9u1_amd64.deb openjdk-8-jdk_8u212-b03-2~deb9u1_amd64.deb    
1

As "addon" to the answer of Emil Chitas using wget:

  • Check the debian site for the current version (e.g. 8u275-b01-1~deb9u1)
  • Copy the version string and set environment-variable before download
  • start download
  • install

Download with:

VER=8u275-b01-1~deb9u1 \
ARCH=amd64 \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre-headless_${VER}_${ARCH}.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre_${VER}_${ARCH}.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk-headless_${VER}_${ARCH}.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk_${VER}_${ARCH}.deb

Install with:

dpkg -i --force-all openjdk-8*
MrD
  • 111