How do I Install Java 8 on Debian?. The first Oracle Java 8 stable version was released on Mar 18, 2014, and available to download and install. Oracle Java PPA for Debian systems is being maintained by Webupd8 Team. JAVA 8 is released with many of new features and security updates. This tutorial will help you to Install Java 8 on Debian 9/8/7 systems using PPA and apt-get command.
The Ubuntu and LinuxMint users use below link to install Java 8 on their system.
Read this => Install Java 10 on Debian
Read this => Install Java 8 on Ubuntu & LinuxMint
Step 1 – Add Java 8 PPA
The webupd8 team has built a Java installer package for Debian systems. You need to add that PPA repository to your system for installing Java 8 on Debian.
Create a new Apt configuration file /etc/apt/sources.list.d/java-8-debian.list, and edit in text editor.
sudo vim /etc/apt/sources.list.d/java-8-debian.list
and add following content in it.
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
Now import GPG key on your system for validating packages before installing them.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
Step 2 – Install Java 8 on Debian
You are all set to start Java installation on Debian. Run the following commands to update apt-cache and then install Java 8 on Debian system using the apt-get package manager.
sudo apt-get update
sudo apt-get install oracle-java8-installer
The installer will prompt for accept Oracle terms in order to continue Java installation on Debian. Accept the terms and complete setup.
Step 3 – Verify Java Installation
Finally, you have successfully installed Oracle Java on your Debian system. Let’s use the following command to verify installed version of Java on your system.
java -version
java version “1.8.0_201”
Java™ SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot™ 64-Bit Server VM (build 25.201-b09, mixed mode)
Step 4 – Setup Java Environment
The Webupd8 PPA repository also provides a package to set environment variables, Install this package using the following command.
sudo apt-get install oracle-java8-set-default