Eclipse Temurin is the OpenJDK distribution built by Eclipse Adoptium—Java SE TCK-tested, widely used in CI and production. On Debian you can install it from the official Adoptium APT repository, unpack a .tar.gz release, and register it with update-alternatives when you need a fixed path under /opt.
This guide covers install Temurin on Debian for Debian 11 (Bullseye), 12 (Bookworm), and 13 (Trixie): add the Adoptium Linux packages repo, install temurin-21-jdk (and other versions), switch defaults with update-java-alternatives, set JAVA_HOME, test compile/run, update, and uninstall. I ran every path on Debian 13 and kept real terminal output below.
Tested on: Debian 13 (trixie); kernel 6.12.94+deb13-amd64; amd64; Temurin 21.0.11+10 via APT and tarball.
Choose an install method
| Method | Best for | Example on test host |
|---|---|---|
Adoptium APT (temurin-21-jdk) |
Most readers; automatic update-java-alternatives hooks |
21.0.11+10 from packages.adoptium.net |
Manual .tar.gz |
Pinning a path under /opt, air-gapped copies, no third-party repo |
Same 21.0.11+10 build from Adoptium API |
Debian openjdk-21-jdk |
Staying on Debian main only (not Temurin, but common alternative) | 21.0.11+10-1~deb13u2 from deb.debian.org |
Package names follow Adoptium’s schema: temurin-<version>-jdk (for example temurin-8-jdk, temurin-17-jdk, temurin-21-jdk, temurin-25-jdk). See supported platforms and the deb package tree for your codename.
Prerequisites
- Debian 11, 12, or 13 on amd64 (other arches appear in Adoptium metadata when published).
- sudo for repository setup and package installs.
- wget or curl and gpg for the Adoptium signing key.
- Disk space: a JDK install is roughly 180–400 MB depending on version and dependencies.
Check what Debian already offers before adding Adoptium:
. /etc/os-release && echo "$PRETTY_NAME ($VERSION_CODENAME)"
java -version 2>&1 || echo "java: not installed"
apt-cache policy default-jdk openjdk-21-jdk temurin-21-jdk 2>/dev/null | head -20On a clean trixie host before Adoptium:
Debian GNU/Linux 13 (trixie) (trixie)
--: line 1: java: command not found
default-jdk:
Candidate: 2:1.21-76
openjdk-21-jdk:
Candidate: 21.0.11+10-1~deb13u2temurin-* candidates appear only after you add the Adoptium repository.
Install Temurin from the Adoptium APT repository
Official steps are documented on Adoptium — Linux (RPM/DEB/APK) installer packages. Repository URLs under packages.adoptium.net/artifactory/ are for apt configuration—they may return 404 in a browser; browse packages at https://packages.adoptium.net/ui/native/deb/dists/ instead.
Add the signing key and repository
sudo apt install -y wget apt-transport-https gpg
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public \
| gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
echo "deb https://packages.adoptium.net/artifactory/deb \
$(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" \
| sudo tee /etc/apt/sources.list.d/adoptium.list
sudo apt update
apt-cache policy temurin-21-jdk | head -10deb https://packages.adoptium.net/artifactory/deb trixie main
Get:7 https://packages.adoptium.net/artifactory/deb trixie InRelease [7,503 B]
temurin-21-jdk:
Candidate: 21.0.11.0.0+10-1
21.0.11.0.0+10-1 500
500 https://packages.adoptium.net/artifactory/deb trixie/main amd64 PackagesOn Bookworm or Bullseye, the awk line expands to bookworm or bullseye automatically—no manual edit when /etc/os-release is standard.
Install a Temurin JDK
Replace 21 with the major you need (17, 21, 25, etc.):
sudo apt install -y temurin-21-jdk
java -version
javac -version
update-java-alternatives --listopenjdk version "21.0.11" 2026-04-21 LTS
OpenJDK Runtime Environment Temurin-21.0.11+10 (build 21.0.11+10-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.11+10 (build 21.0.11+10-LTS, mixed mode, sharing)
javac 21.0.11
temurin-21-jdk-amd64 2111 /usr/lib/jvm/temurin-21-jdk-amd64The .deb registers java, javac, and related tools through update-alternatives—the same integration described for Ubuntu on Ask Ubuntu — Temurin with update-alternatives.
sources.list entries on production servers—the same caution you would apply to any external APT source.
Install Temurin from a release archive
When you do not want an APT repository, download a .tar.gz from Adoptium—either from Temurin releases or the REST API:
curl -sL 'https://api.adoptium.net/v3/assets/latest/21/hotspot?architecture=x64&image_type=jdk&os=linux&vendor=eclipse' \
| python3 -c "import sys,json; d=json.load(sys.stdin)[0]; print(d['binary']['package']['link'])"Example URL returned on the test host:
https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.11%2B10/OpenJDK21U-jdk_x64_linux_hotspot_21.0.11_10.tar.gzDownload, extract under /opt, and test the bundled binaries:
cd /tmp
wget -q --show-progress 'https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.11%2B10/OpenJDK21U-jdk_x64_linux_hotspot_21.0.11_10.tar.gz'
sudo mkdir -p /opt/temurin-21
sudo tar -xzf OpenJDK21U-jdk_x64_linux_hotspot_21.0.11_10.tar.gz -C /opt/temurin-21 --strip-components=1
/opt/temurin-21/bin/java -versionopenjdk version "21.0.11" 2026-04-21 LTS
OpenJDK Runtime Environment Temurin-21.0.11+10 (build 21.0.11+10-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.11+10 (build 21.0.11+10-LTS, mixed mode, sharing)Register the manual install with update-alternatives
APT packages use update-java-alternatives. Tarball installs use update-alternatives directly (manual pattern used across many guides):
sudo update-alternatives --install /usr/bin/java java /opt/temurin-21/bin/java 2112
sudo update-alternatives --install /usr/bin/javac javac /opt/temurin-21/bin/javac 2112
sudo update-alternatives --set java /opt/temurin-21/bin/java
java -version
readlink -f "$(which java)"update-alternatives: using /opt/temurin-21/bin/java to provide /usr/bin/java (java) in manual mode
openjdk version "21.0.11" 2026-04-21 LTS
/opt/temurin-21/bin/javaUse a higher priority number (here 2112) when you want the manual build to win over an existing 2111 APT JDK.
Switch between multiple JDK installations
After installing both Temurin and Debian OpenJDK for comparison:
sudo apt install -y openjdk-21-jdk
update-java-alternatives --listjava-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64
temurin-21-jdk-amd64 2111 /usr/lib/jvm/temurin-21-jdk-amd64Set the default JVM:
sudo update-java-alternatives --set temurin-21-jdk-amd64
java -version 2>&1 | head -1openjdk version "21.0.11" 2026-04-21 LTSSwitch to Debian’s build:
sudo update-java-alternatives --set java-1.21.0-openjdk-amd64
java -version 2>&1 | head -3openjdk version "21.0.11" 2026-04-21
OpenJDK Runtime Environment (build 21.0.11+10-1-deb13u2-Debian)
OpenJDK 64-Bit Server VM (build 21.0.11+10-1-deb13u2-Debian, mixed mode, sharing)For tarball-only installs mixed with APT JDKs, use sudo update-alternatives --config java when both are registered.
Set JAVA_HOME
Point JAVA_HOME at the JVM root—not the bin directory:
export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64
export PATH="$JAVA_HOME/bin:$PATH"
java -versionPersist for all users:
echo 'export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64' | sudo tee /etc/profile.d/temurin.sh
echo 'export PATH="$JAVA_HOME/bin:$PATH"' | sudo tee -a /etc/profile.d/temurin.shFor /opt/temurin-21, use export JAVA_HOME=/opt/temurin-21 instead.
Verify with a sample Java program
mkdir -p ~/javatest
cat > ~/javatest/Hello.java <<'EOF'
public class Hello {
public static void main(String[] args) {
System.out.println("Hello from Temurin on Debian");
}
}
EOF
javac ~/javatest/Hello.java
java -cp ~/javatest HelloHello from Temurin on DebianIf javac: command not found, you installed a JRE-only package or PATH omits $JAVA_HOME/bin.
Temurin vs Debian OpenJDK (quick reference)
| Eclipse Temurin | Debian OpenJDK | |
|---|---|---|
| Package | temurin-21-jdk (Adoptium repo) |
openjdk-21-jdk (Debian main) |
| JVM path | /usr/lib/jvm/temurin-21-jdk-amd64 |
/usr/lib/jvm/java-1.21.0-openjdk-amd64 |
| Updates | apt upgrade after Adoptium publish |
Debian security/archive |
| Switch tool | update-java-alternatives |
update-java-alternatives |
Debian 13 also ships openjdk-25-jdk in main for the newest OpenJDK line; Temurin temurin-25-jdk is available from Adoptium when you want their build on older suites too.
Update Temurin
sudo apt update
sudo apt install --only-upgrade temurin-21-jdk
java -versionRe-run sudo apt update after Adoptium publishes a new build. For tarball installs, download the newer archive, extract to a new directory, adjust update-alternatives, and remove the old tree.
List installed JDK packages with list installed packages on Debian or:
dpkg -l 'temurin-*' 'openjdk-*-jdk' 2>/dev/null | grep ^iiUninstall Temurin
APT package
sudo apt remove --purge temurin-21-jdk
sudo apt autoremoveRemove the repository when finished:
sudo rm -f /etc/apt/sources.list.d/adoptium.list /etc/apt/trusted.gpg.d/adoptium.gpg
sudo apt updateManual /opt install
sudo update-alternatives --remove java /opt/temurin-21/bin/java
sudo update-alternatives --remove javac /opt/temurin-21/bin/javac
sudo rm -rf /opt/temurin-21
rm -f /tmp/OpenJDK21U-jdk_x64_linux_hotspot_21.0.11_10.tar.gzIf update-alternatives --remove reports the link is still in use, --set another JDK first (for example sudo update-java-alternatives --set java-1.21.0-openjdk-amd64).
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
temurin-21-jdk has no Candidate |
Adoptium repo not added or wrong codename | Re-run the adoptium.list echo line; confirm bookworm / bullseye / trixie in the file |
400 Bad Request fetching .deb |
Stale apt metadata or past installer issue #766 on some suites | sudo apt update; verify codename; try again or use the tarball path |
java: command not found after install |
PATH or alternatives not set |
update-java-alternatives --list; which java; set JAVA_HOME |
javac: command not found |
JRE-only install | Install temurin-XX-jdk, not a runtime-only variant |
Wrong vendor in java -version |
Multiple JDKs installed | sudo update-java-alternatives --set temurin-21-jdk-amd64 or update-alternatives --config java |
| Browser 404 on artifactory URL | Normal—repos are for package managers | Use Adoptium installation docs or the API download above |
References
- Adoptium — Install Eclipse Temurin
- Adoptium — Linux (RPM/DEB/APK) packages
- Eclipse Temurin Linux installers announcement
- Adoptium installer issues (GitHub)
- On-site: APT command, sudo, wget, curl, list installed packages on Debian
Summary
Install Temurin on Debian by adding the Adoptium APT repository, running sudo apt install temurin-21-jdk, and confirming with java -version. For a fixed /opt layout, unpack the official .tar.gz and wire it with update-alternatives. Use update-java-alternatives when several APT JDKs are installed, set JAVA_HOME to the JVM directory, and remove the package or tarball when you no longer need it.

