How to install Oracle JDK 8 on Debian 9

The Java programming language is used for very many applications. We will consider installing Oracle JDK 8 on the Debian 9 operating system.

- Debian 9
- a sudo non-root user

To install Oracle JDK 8 we first need to install the software-properties-common package in order to use the apt-get-repository command. This will work to add the repository to your sources list and import the associated key.

sudo apt-get install software-properties-common

Type y for yes, when prompted to confirm the installation.

To ensure that we get the correct source line on Debian, we’ll need to run the following command that also modifies the line:

sudo add-apt-repository "deb xenial main"

Then update apt:

sudo apt-get update

Next, install Oracle JDK 8:

sudo apt-get install oracle-java8-installer

To verify the installation is complete, type:

javac -version

You'll see like this:

javac 1.8.0_171



We will be happy to hear your thoughts

Leave a reply