Home How to install Oracle JDK 8 on Debian 9
Post
Cancel

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. Prerequisites:

  • 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.
    1
    
    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:

1
sudo add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"

Then update apt:

1
sudo apt-get update

Next, install Oracle JDK 8:

1
sudo apt-get install oracle-java8-installer

To verify the installation is complete, type:

1
javac -version

You’ll see like this:

1
javac 1.8.0_171