Skip to content

Instantly share code, notes, and snippets.

@gelin
Created February 20, 2020 15:43
Show Gist options
  • Save gelin/a07ab7d18b988fc2203f0f196f94a8a8 to your computer and use it in GitHub Desktop.
Save gelin/a07ab7d18b988fc2203f0f196f94a8a8 to your computer and use it in GitHub Desktop.
OpenJDK 8 in Debian 8

You need to add the Backports repository where the OpenJDK 8 package is located.

Add the file /etc/apt/sources.list.d/backports.list with this content:

# Backports repository
deb  http://ftp.debian.org/debian jessie-backports main contrib non-free

(You may replace http://ftp.debian.org/debian with any closer mirror, or even http://httpredir.debian.org/debian.)

Update packages.

# apt update

Install OpenJDK 8.

# apt -t jessie-backports install openjdk-8-jdk

(Maybe you need to install only openjdk-8-jre package.)

If you have other JDK/JREs installed you may want to use Java 8 by default. Update alternatives for java and javac.

# update-java-alternatives --set java-1.8.0-openjdk-amd64
# update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment