I recommend temurin jdk and they have their own packages. Zulu is also good. https://adoptium.net/installation/linux/ https://docs.azul.com/core/install/debian Answer from deke28 on reddit.com
๐ŸŒ
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 for all architecture.
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ how-to-install-java-with-apt-on-debian-11
How To Install Java with Apt on Debian 11 | DigitalOcean
September 1, 2022 - In this guide, you will install different versions of the Java Runtime Environment (JRE) and the Java Developer Kit (JDK) using Apt. Youโ€™ll install OpenJDK aโ€ฆ
๐ŸŒ
Reddit
reddit.com โ€บ r/linux4noobs โ€บ how can i install java 21 on debian 12 without resorting to sid?
r/linux4noobs on Reddit: How can i install Java 21 on Debian 12 without resorting to sid?
July 15, 2024 -

EDIT: I've ended up installing Microsoft's OpenJDK 21. Had a nice instructions to setup and i didnt need to mess up my debian repositories to get the thing (only add MS one). Sorry die-hard Linux fans

I'm trying to install the JRE of Java 21 in my Debian 12 headless machine, for Minecraft server purposes.

Unfortunately i saw that the packages of 21 aren't available in stable repositories, only on sid (unstable). I don't want to add the whole sid repository to avoid instability and since the only package i want is this one.

So, is there any way to install Java 21 using either apt or a .deb file - without resorting to unpack a .tar.gz? Should i download the .deb on the website and try to install it via gdebi-core? I read that this isn't an advised thing to do due to dependencies and such...

๐ŸŒ
TecMint
tecmint.com โ€บ home โ€บ debian โ€บ how to install java jdk 21 on debian 12
How to Install Java 21 (JDK) on Debian 12
June 27, 2024 - The easiest way to install Java 21 on Debian 12 is by using the apt package manager as a regular user with sudo privileges and updating the system packages as shown.
๐ŸŒ
RoseHosting
rosehosting.com โ€บ home โ€บ how to install java 25 on debian 13
How to Install Java 25 on Debian 13 | RoseHosting
December 10, 2025 - In this article, we cover how to install Java 25 on Debian 13 from various sources, using the apt package manager for Java OpenJDK, and by downloading it from Oracle โ€“ specifically, the Oracle JDK. For most users, OpenJDK is sufficient and offers an easy way to install Java 25 JDK.
Top answer
1 of 12
158

Alternatively, you can use adoptopenjdk repository:

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

https://adoptopenjdk.net/installation.html

2 of 12
80

WARNING: this answer suggest unsupported and dangerous mixing of Debian releases. Follow the advice on your own risk, as it can break the system on upgrades, as explained in http://wiki.debian.org/DontBreakDebian#Don.27t_make_a_FrankenDebian

Package mirror search steps:

  1. In the Search package directories search for openjdk-8-jdk. You can see two results:

    • stretch (oldstable) (java): OpenJDK Development Kit (JDK)
    • sid (unstable) (java): OpenJDK Development Kit (JDK)
  2. Choose stretch repository

  3. Scroll to the Download openjdk-8-jdk section and choose your architecture. For example amd64

  4. Now you can see mirrors list and instructions how to install the package via apt:

    You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:

    deb http://security.debian.org/debian-security stretch/updates main

Installation steps:

  1. Install software source manager

    apt-get update
    apt-get install software-properties-common
    
  2. Add mirror with openjdk-8-jdk

    apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
    apt-get update
    
  3. Install openjdk 8

    apt-get install openjdk-8-jdk
    

Note: You can use steps above to find an official Debian mirror with any other package you want to install

๐ŸŒ
Linuxize
linuxize.com โ€บ home โ€บ java โ€บ how to install java on debian 10 linux
How to Install Java on Debian 10 Linux | Linuxize
February 24, 2020 - In this tutorial, we will explain how to install Java (OpenJDK) on Debian 10 Linux.
๐ŸŒ
Pi My Life Up
pimylifeup.com โ€บ home โ€บ installing newer versions of java on debian systems
Installing Newer Versions of Java on Debian Systems - Pi My Life Up
January 21, 2026 - This repository builds for any LTS release of Java, giving you access from Java 8 to Java 25 on your Debian system. Best of all, once a repository has been set up, you will continue to get updates to Java as they are pushed by the repository maintainers. The steps below walk you through adding the Adoptium repository to gain access to newer versions of Java. The Apdotium repository provides Java builds under the Temurin name and is available for both AMD64 and ARM64(AARCH64) systems. These steps for installing newer versions of Java from Temurin are intended for Debian-like systems, such as Ubuntu.
Find elsewhere
๐ŸŒ
Linuxiac
linuxiac.com โ€บ home โ€บ tutorials โ€บ how to install java on debian 12 (bookworm)
How to Install Java on Debian 12 (Bookworm)
August 4, 2023 - So, using the APT command below will install OpenJDK 17 LTS on your Debian 12 (Bookworm) system. sudo apt install default-jdkCode language: JavaScript (javascript)
๐ŸŒ
SharpHeberg
sharpheberg.com โ€บ blog โ€บ install-java-25-on-debian
How to Install Java 25 on Debian (9โ€“13)
January 8, 2026 - Install Java 25 on Debian (9-13) with this easy step-by-step guide. Download and set up JDK 25 quickly on your Debian-based system.
๐ŸŒ
Techtutelage
techtutelage.net
How to Install Java on Debian-based Linux โ€“ TechTutelage
In this guide, Iโ€™ll walk you through the process of installing Java on your Debian-based Linux system.
๐ŸŒ
Linuxize
linuxize.com โ€บ home โ€บ java โ€บ how to install java on debian 9
How to Install Java on Debian 9 | Linuxize
February 24, 2020 - Use the following command to install OpenJDK 8 JDK from the standard Debian repositories: ... openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1~deb9u1-b01) OpenJDK 64-Bit Server VM (build 25.212-b01, mixed mode) Thatโ€™s it! At this point, you should have successfully installed Java on your Debian system.
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.

๐ŸŒ
Myvestacp
forum.myvestacp.com โ€บ board index โ€บ knowledge base โ€บ linux tutorials โ€บ linux services
How to install Java on Debian - myVesta
apt install -y default-jre default-jdk With these two commands, you have successfully installed Java on your Debian system along with myVesta CP.
๐ŸŒ
HowtoForge
howtoforge.com โ€บ home โ€บ how to install java (jdk and jre) on debian 10
How to Install Java (JDK and JRE) on Debian 10
Run the 'apt info' command below to get details about the Java package. ... Now you will get the details package as below. Next, install the 'default-jdk' package using the apt command below.
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ how-to-install-java-with-apt-on-debian-10
How To Install Java with Apt on Debian 10 | DigitalOcean
July 26, 2019 - This will install the Java Runtime Environment (JRE), allowing you to run almost all Java software. ... Outputopenjdk version "11.0.4" 2019-07-16 OpenJDK Runtime Environment (build 11.0.4+11-post-Debian-1deb10u1) OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Debian-1deb10u1, mixed mode, sharing)
๐ŸŒ
LinuxCapable
linuxcapable.com โ€บ home โ€บ debian โ€บ how to install openjdk 25 on debian 13, 12 and 11
How to Install OpenJDK 25 on Debian 13, 12 and 11 - LinuxCapable
May 11, 2026 - Install OpenJDK 25 on Debian 13, 12, and 11 via APT or Eclipse Temurin. Covers version switching, JAVA_HOME, and troubleshooting.
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ how-to-install-java-with-apt-get-on-debian-8
How To Install Java with Apt-Get on Debian 8 | DigitalOcean
June 28, 2017 - When prompted to confirm the installation, type y for yes. To ensure that we get the correct source line on Debian, weโ€™ll need to run the following command that also modifies the line: sudo add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
๐ŸŒ
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.
๐ŸŒ
Webhi
webhi.com โ€บ home โ€บ how to install java with โ€œapt-getโ€ on ubuntu / debian
How to install Java with "apt-get" on Ubuntu / Debian - Tutorial & Documentation
June 26, 2023 - Ubuntu provides OpenJDK as the default Java Development Kit (JDK) in its package repository. To install OpenJDK using the apt-get package manager, use the following command: ... This command will download and install the default version of OpenJDK available for your Ubuntu distribution.