Thorsten Glaser, the current maintainer of OpenJDK 8 in Debian, 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, openjdk-8-jre, etc. available for installation as usual:

sudo apt install openjdk-8-jdk
Answer from Stephen Kitt on Stack Exchange
🌐
GitHub
gist.github.com › ansulev › 1b924e87bd091b1d78e06d918faa8fcf
Install Java 8 or 11 on Debian 12 · GitHub
Install Java 8 or 11 on Debian 12. GitHub Gist: instantly share code, notes, and snippets.
🌐
Reddit
reddit.com › r/debian › [deleted by user]
[deleted by user] : r/debian
April 7, 2024 - I resorted to using the Adoptium Debian Repository that provides OpenJDK packages for Java 8 (temurin-8-jdk). More replies ... You can use Amazon's Corretto JDK builds, for example: https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/generic-linux-install.html ... Note though that these are NOT available for Debian 12 as OP requested.
🌐
Reddit
reddit.com › r/debian › where is java 8? (debian 12)
r/debian on Reddit: Where is java 8? (Debian 12)
November 15, 2023 -

Hello all.

I just want to ask why there is no package for jdk 1.8 forDebian 12? I've seen one for Sid the open-jdk-8.

Why is it so?

Can I change my sources.list for sid, install open-jdk-8 and then revert sources back to bookworm?

Thank you for your responses.

Top answer
1 of 15
16
I just want to ask why there is no package for jdk 1.8 forDebian 12? Debian only maintains a single JDK per release, because of the work it entails. (Also, it probably doesn't help that OpenJDK 8 was originally supposed to be EOL by now .) Can I change my sources.list for sid, install open-jdk-8 and then revert sources back to bookworm? I would avoid doing this. If you don't run in to any problems with mixing releases, that still leaves you with no way of getting security updates for Java. If you definitely need an alternative version of Java, third-party repositories are probably your best bet. I don't personally know what people currently prefer to use, but the Zula builds of OpenJDK are offered by extrepo , so that would be an easy thing to try first.
2 of 15
9
why there is no package for jdk 1.8 for Debian 12? Because openjdk-8 was superseded by openjdk-11, which in turn was superseded by openjdk-14, which in turn was superseded by openjdk-17, which is the default java version in Debian 12. Can I change my sources.list for sid, install open-jdk-8 and then revert sources back to bookworm? You probably can do that, but then you will get a lot of other packages from sid, and your system will become a "frankendebian". Not recommended. In general, installing packages from testing or unstable on a system running stable is not a good idea. Whenever I needed an old java version I usually take it from a previous release (not from testing or unstable). That usually works. But openjdk-8 is too old and it's not even in Debian 11. The real question here would be: Why are you still using java 8?
Top answer
1 of 3
6

Copies of past Debian packages are available at http://snapshot.debian.org/

You can search there for openjdk-8. The last available version is 8u322-b06-1~deb9u1, logged at http://snapshot.debian.org/package/openjdk-8/8u322-b06-1%7Edeb9u1/ You can download the binary packages (.deb) for your architecture and install with sudo dpkg -i *.deb.

Whether it works or not depends on the library versions that it was built against. 8u312-b07-1 (and other older versions) is also available.

Alternatively you can access the Debian tracking page for the package at https://tracker.debian.org/pkg/openjdk-8. openjdk-8 is still listed there as available for unstable (as version 8u312-b07-1). If you click on the links for the binary packages, they will lead you to download links for the deb packages.

snapshot.debian.org is arguably simpler for ad-hoc downloading since it has the deb files in one place (the debian package repository finds them in http://ftp.us.debian.org/debian/pool/main/o/openjdk-8/ or its mirror sites)

snapshot.debian.org also suggests instructions for configuring sources.list. But if the package is not likely to be updated often then it might be simpler to just download the deb files manually.

2 of 3
5

Since Oracle changed Java licensing, Bellsoft (not affiliated) has done a great job at providing openJDK installers. They just work, and you can choose between:

  • JDK / JRE
  • Java 8 / 11 / 17 / 19
  • With or without JavaFX
  • Windows / Debian / Redhat / Alpine / Solaris / macOs installer

You'll surely find the correct installer at https://bell-sw.com/pages/downloads/#/java-8-lts.

You can install multiple Java versions if you wish. If you need to juggle between versions, you might be interested in this answer.

🌐
Linux Genie
linuxgenie.net › home › how to install java on debian 12?
How to Install Java on Debian 12? - Linux Genie
December 1, 2023 - There are several methods to install ... the latest version of JDK available on the apt repository, execute the “sudo apt install default-jdk” command....
🌐
Ultimate Systems Blog
blog.usro.net › ultimate systems blog › how-to › linux › how to install java on debian 12
How to Install Java on Debian 12 – Ultimate Systems Blog
October 27, 2024 - Sometimes you might need more than one Java version—say you’re developing applications that need both Java 8 and Java 17 (a typical developer’s dilemma). No problem; Debian 12 can handle it. Install both versions:sudo apt install openjdk-8-jdk ...
🌐
Linuxiac
linuxiac.com › home › tutorials › how to install java on debian 12 (bookworm)
How to Install Java on Debian 12 (Bookworm)
August 4, 2023 - Although Java 11 LTS is now the most widely used version, followed closely by Java 8 LTS, looking ahead and following Oracle’s guidance, Java 17 LTS is the way to go. Fortunately, this is precisely the version available in Debian 12’s repositories. First, ensure Java is not already installed on ...
Find elsewhere
🌐
idroot
idroot.us › home › how to install java on debian 12
How To Install Java on Debian 12 - idroot
August 11, 2025 - In this tutorial, we will show you how to install Java on Debian 12 (Bookworm), as well as some extra requirements for Java
🌐
Linux Hint
linuxhint.com › install-java-debian
How to Install Java on Debian 12: A Step By Step Guide – Linux Hint
You can install Java on Debian from apt package manager, deb file and SDKMAN. For more details, read this guide.
🌐
Its Linux FOSS
itslinuxfoss.com › home › debian › how to install openjdk-8 on debian 12?
How to Install OpenJDK-8 on Debian 12? – Its Linux FOSS
July 10, 2023 - To do so, paste the below-mentioned ... configured successfully. To install the OpenJDK-8 on Debian 12, download the tar package from the official website of Oracle....
🌐
TecAdmin
tecadmin.net › install-java-8-on-debian
How To Install Java 8 on Debian 10/9/8 via PPA - TecAdmin
April 26, 2025 - How do I Install Java 8 on Debian?. The first Oracle Java 8 stable version was released on Mar 18, 2014, and available to download and install. Oracle Java PPA for Debian systems is being maintained by Webupd8 Team. JAVA 8 is released with many of new features and security updates.
🌐
Reddit
reddit.com › r/linux4noobs › how to install java 8 to debian?
r/linux4noobs on Reddit: how to install java 8 to debian?
July 3, 2024 -

Trying to run a minecraft mod-pack on debian and I need java version 8. I am running PolyMc off of flatpak and it says:

This instance is not compatible with Java version 21.

Please switch to one of the following Java versions for this instance:

Java version 8

Minecraft 1.21 runs without an issue but this mod pack requires minecraft 1.12.2

I had trouble installing with sudo apt-get install openjdk-8-jdk because debian package does not exist. Message I get is:

E: Unable to locate package openjdk-8-jdk

what do I do in this situation?

Edit: java path is set to /app/jdk/21/bin/java and I can change it when I want

🌐
Debian
packages.debian.org › sid › amd64 › openjdk-8-jdk › download
Debian -- Package Download Selection -- openjdk-8-jdk_8u482-ga-1_amd64.deb
If you are running Debian, it is strongly suggested to use a package manager like aptitude or synaptic to download and install packages, instead of doing so manually via this website. You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this: ... Replacing ftp.de.debian.org/debian with the mirror in question. You can download the requested file from the pool/main/o/openjdk-8/ subdirectory at any of these sites:
🌐
Shapehost
shape.host › home › resources › how to install java on debian 12
How to Install Java on Debian 12 - Shapehost
February 23, 2025 - Learn how to install Java on Debian 12. Set up this programming language to build and run applications, web services, and enterprise software.
🌐
Debian
wiki.debian.org › Java
Java - Debian Wiki
Each of them have a development environment (JDK) and a runtime (known as JRE, or Java Virtual Machines JVM). Here's a list of Java environment. Just run aptitude search "?provides(java-runtime)" on your system to list available packages). The default JRE/JDK installed in Debian isn't the same ...
🌐
Greenwebpage
greenwebpage.com › home › blog › how to install java on debian 12: using apt and deb
How to Install Java on Debian 12: Using Apt and Deb
May 10, 2025 - This tutorial walks you through steps to install Java on Debian 12 using both apt package manager and .deb.