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 usualapt-get install openjdk-8-jdkand apt-cache search openjdk only returns the openjdk-11.
3 Answers
The answer over at SO is nicer:
wget -qO - | sudo apt-key add -
sudo add-apt-repository --yes
sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot I've managed to solve it by manually downloading the packages with wget:
RUN wget \
&& wget \
&& wget \
&& wget 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 2 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 \
&& wget \
&& wget \
&& wget Install with:
dpkg -i --force-all openjdk-8*