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 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
sudo apt-get update
Next, install Oracle JDK 8:
sudo apt-get install oracle-java8-installer
To verify the installation is complete, type:
You'll see like this: