The disappearance of openjdk-8-jdk
from Debian 10 (Buster) repositories isn't a bug - it's an intentional lifecycle decision. OpenJDK 8 reached end-of-life (EOL) for mainstream Debian support in Buster, though it remains available in older releases:
# Check available JDK versions in Buster:
apt-cache search --names-only '^openjdk-[0-9]*-jdk'
Debian follows strict guidelines for Java package maintenance. When a JDK version moves to LTS (Long Term Support) status, it typically gets:
- Removed from main repositories
- Moved to backports or non-free sections
- Requires manual repository configuration
Option 1: Install from Debian Backports
# Add backports repository
echo "deb http://deb.debian.org/debian buster-backports main" | tee /etc/apt/sources.list.d/buster-backports.list
# Install specific version
apt-get update
apt-get -t buster-backports install openjdk-8-jdk
Option 2: Use AdoptOpenJDK (now Eclipse Temurin)
# Add the AdoptOpenJDK repository
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb buster main" > /etc/apt/sources.list.d/adoptopenjdk.list
# Install specific version
apt-get update
apt-get install adoptopenjdk-8-hotspot
Option 3: Manual .tar.gz Installation
# Download from official source
wget https://download.java.net/openjdk/jdk8u41/ri/openjdk-8u41-b04-linux-x64-14_jan_2020.tar.gz
# Extract and install
tar -xzf openjdk-8u41-b04-linux-x64-14_jan_2020.tar.gz -C /usr/lib/jvm/
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-8-openjdk-amd64/bin/java" 1
update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/bin/java
For containerized environments, consider this optimized Dockerfile approach:
FROM debian:buster-slim
RUN apt-get update && \
apt-get install -y wget && \
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add - && \
echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb buster main" > /etc/apt/sources.list.d/adoptopenjdk.list && \
apt-get update && \
apt-get install -y adoptopenjdk-8-hotspot && \
rm -rf /var/lib/apt/lists/*
# Verify installation
CMD ["java", "-version"]
After installation, verify the correct Java version is being used:
# Check installed version
java -version
# Set JAVA_HOME permanently
echo "export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))" >> /etc/profile.d/java.sh
source /etc/profile.d/java.sh
When using EOL Java versions:
- Monitor for CVEs using tools like OWASP Dependency-Check
- Isolate the JDK using containerization
- Consider implementing network-level protections
- Document the exception in your security policy
If you're running Debian 10 (buster) and trying to install OpenJDK 8, you'll notice the package is no longer available in the main repositories. This isn't a bug or mistake - it's a deliberate decision by the Debian maintainers.
$ apt-cache search --names-only '^openjdk-8*'
# Only returns OpenJDK 11 packages
Debian follows a strict policy regarding package maintenance. OpenJDK 8 reached its end of life for mainstream support from Oracle in March 2022. While it was available in Debian 9 (stretch), it was removed from Debian 10 (buster) because:
- Security updates were no longer guaranteed
- The package needed significant maintenance resources
- Most applications had migrated to newer Java versions
If you absolutely need OpenJDK 8 on Debian 10, you have several options:
Option 1: Use Debian Backports
Add the stretch-backports repository:
echo "deb http://deb.debian.org/debian stretch-backports main" | tee /etc/apt/sources.list.d/stretch-backports.list
apt-get update
apt-get install -t stretch-backports openjdk-8-jdk
Option 2: Install from AdoptOpenJDK
AdoptOpenJDK provides LTS builds:
wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz
tar -xzf OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz
mv jdk8u292-b10 /usr/lib/jvm/java-8-openjdk-amd64
update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-openjdk-amd64/bin/java 1
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac 1
Option 3: Use Docker Containers
For isolated environments, consider using a Docker image with OpenJDK 8:
docker pull adoptopenjdk/openjdk8:debian
docker run -it adoptopenjdk/openjdk8:debian bash
After installation, verify it works:
java -version
# Should show: openjdk version "1.8.0_292"
javac -version
# Should show: javac 1.8.0_292
While OpenJDK 8 can still be installed, consider migrating to a supported version. Here's a compatibility checklist:
- Test your application with OpenJDK 11 (LTS)
- Update deprecated API calls
- Check dependency compatibility
- Review module system changes (if applicable)