(Last Updated On: March 5, 2018)

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

The updated article is on:

Installing latest Oracle Java 9 on Ubuntu / Debian

Most articles you read online will give you hard to follow procedure but this is a straightforward guide and you will always get latest version of java on your distro.
If you are on Kali Linux 2.0, make sure you have correct repositories in your sources.list file.You can find the correct way of doing that from my previous article How to upgrade to Kali Linux 2.0 (Kali Sana) from Kali Linux 1.x 

Then after that
1) Switch to root account or use sudo, with the first one you’ll enter the root password and with the second one you’ll enter your normal user account password.

su -


sudo su -

2) Add webupd8team repositories to your system. Just copy paste following commands on your 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 

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 

3) Then add the key to use the repos

$ 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 commands on your terminal.

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

4) Next thing to do is a system update of apt-cache index.

$ sudo apt-get update

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

$ sudo apt-get install oracle-java8-installer

After java downloading and installing successfully, check your Java version

java -version

You should see output similar to one below with Java 8 latest.

On Kali Linux 2.0, make sure you have kernel headers installed to avoid any problem on your working env. here is the link to How to install Linux Kernel Headers on Kali Linux 2.0 (Kali Sana)

Thanks for reading. feel free to drop a comment in case you encounter any error or problem.
Search Tags:
How to install java on kali linux. How to install latest Java JDK
Getting latest java on debian,ubuntu and Kali Linux
Kali Linux java latest installation
Updating java on  debian,ubuntu and kali linux to latest version.