How to Install Java 8 on Debian 8/9/10, Ubuntu 16/18/20, and CentOS 6/7/8

123

Installation on Debian 8/9/10

To install Java 8 on Debian 8, 9, or 10, execute the commands:

Debian 9

apt-get update
apt-get install default-jdk

Debian 10

apt-get install software-properties-common
apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
apt-get update
apt-get install openjdk-8-jdk

For installation on Debian 8, use the universal method.

Installation on Ubuntu 16.04/18.04/20.04

To install Java 8 on Ubuntu 16.04, 18.04, or 20.04, execute the commands:

Ubuntu 16.04

apt-get update
apt-get install default-jdk

Ubuntu 18.04, 20.04

apt-get update
apt-get install openjdk-8-jdk

Installation on CentOS 6/7/8

To install Java 8 on CentOS 6, 7, or 8, execute the commands:

CentOS 6, 7, 8

yum update
yum install java-1.8.0-openjdk

We value your privacy

We use cookies and process your IP address to personalize content, detect your location for regional pricing, analyze site traffic, and show relevant ads. We share data with our analytics and advertising partners. Click "Accept All" to consent to all cookies, or "Reject All" to decline non-essential cookies. Some essential cookies will always be used for the site to function. Learn more in our Privacy Policy