How to install the latest Java JDK on Debian 8, Kali Linux 2.0 and Ubuntu 15.04

Welcome to our article “How to install the latest Java JDK on various Linux distributions”. Many applications require Java on your computer to run smoothly. This tutorial will guide you through the complete process of installing the latest Java on Kali Linux 2.0, Debian Jessie 8 and any Ubuntu derivative.

Updated articles are located at:

Install the latest Oracle Java 9 on Ubuntu / Debian

Most articles you read online will make it difficult for you to follow this step, but this is an easy-to-understand guide and you will always get the latest version of Java on your distribution.
If you are using Kali Linux 2.0, make sure you have the correct repository in your sources.list file. You can find the right storage method from my previous article How to upgrade from Kali Linux 1 to Kali Linux 2.0 (Kali Sana). X

after that
1) Switch to the root account or use sudo, the first one is to enter your root password and the second one is to enter your normal user account password.

su -

Either

sudo su -

2) Add the webupd8team repository to your system. Just copy and paste the following command on the terminal.

For Ubuntu 16.04, use:

cat >/etc/apt/sources.list.d/webupd8team-java.list<< EOF
deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main 
EOF

For Ubuntu 14.04

cat >/etc/apt/sources.list.d/webupd8team-java.list<< EOF
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main 
EOF

3) Then add the key to use the repository

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886

For any Debian, use:

To add the required PPA, run the following command on the terminal.

$ sudo add-apt-repository ppa:webupd8team/java

4) The next thing to do is to perform a system update on the apt-cache index.

$ sudo apt-get update

5) Finally, install the oracle java 8 installer, which will download and install java for you.

$ sudo apt-get install oracle-java8-installer

After Java is downloaded and successfully installed, please check your Java version

java -version

You should see output similar to the latest Java 8 below.

How to install the latest Java JDK on Debian 8, Kali Linux 2.0 and Ubuntu 15.04

On Kali Linux 2.0, make sure that the kernel headers are installed to avoid any issues in the working environment. Here is a link on how to install the Linux kernel headers on Kali Linux 2.0 (Kali Sana).

thanks for reading. If you encounter any errors or issues, feel free to comment.
How to install Java on Kali Linux. How to install the latest Java JDK
Get the latest Java on Debian, Ubuntu and Kali Linux
Kali Linux Java latest installation
Update Java to the latest version on debian, ubuntu and kali linux.

Sidebar