6

Under Debian 11, we typically use OpenJDK from adoptopenjdk.net.

This organization will no longer provide new releases: https://adoptopenjdk.jfrog.io/ui/native/deb/dists/

Is there a way to install Java 8 JDK (not the runtime) on a Debian 12?

muru
  • 69,900
  • 13
  • 192
  • 292
realtebo
  • 799
  • 9
  • 23

2 Answers2

7

I am using the distrubution offered by adoptium, called temurin-8-jdk

mkdir -p /etc/apt/keyrings

wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc

echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list

apt update 

apt install temurin-8-jdk

Optional to switch from an old repository

update-alternatives --config java # choose new java
update-alternatives --config javac # choose new javac
realtebo
  • 799
  • 9
  • 23
5

Thorsten Glaser provides a repository which includes OpenJDK 8, built using the Debian OpenJDK 8 package (see also Debian bug #989736).

To install it on Debian 12, download the appropriate repository configuration file:

wget http://www.mirbsd.org/~tg/Debs/sources.txt/wtf-bookworm.sources
sudo mkdir -p /etc/apt/sources.list.d
sudo mv wtf-bookworm.sources /etc/apt/sources.list.d/
sudo apt update

You’ll then see openjdk-8-jdk etc. available for installation as usual:

sudo apt install openjdk-8-jdk
Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164