How To Install Java 8 In Kali Linux ( Openjdk8 ) | By H4Ck3R

How To Install Java 8 In Kali Linux

Java is a programming language used to develope android apps , web apps , desktop apps , games and much more .

About Kali Linux

Kali Linux is a Linux distribution that is specialized for tasks like cybersecurity. It is an open-source product with a lot of customization done for penetration testing, so that it helps many companies to identify their vulnerabilities.

Kali linux is used for penetrations testing , security research , computer forensics , and reverse engineering.


1. Its Free

2. Open source

3. Thousands of tools

4. Full customization

5. Multi Language Support

Java Installation

Step 1

Download Java 8u191

wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie;" ""

Download Java 8u131

wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie"


Step 2

  • sudo mkdir /usr/lib/jvm
  • cd ~/usr/lib/jvm
  • sudo tar -xvzf ~/Downloads/jdk-8u191-linux-x64.tar.gz

Step 3

Edit Environment File

  • sudo nano /etc/environment

Add This 3 Lines

  • /usr/lib/jvm/jdk1.8.0_191/bin
  • /usr/lib/jvm/jdk1.8.0_191/db/bin
  • /usr/lib/jvm/jdk1.8.0_191/jre/bin

At The End Of Environment File Paste This

  • J2SDKDIR=”/usr/lib/jvm/jdk1.8.0_191″
  • J2REDIR=”/usr/lib/jvm/jdk1.8.0_191/jre”
  • JAVA_HOME=”/usr/lib/jvm/jdk1.8.0_191″
  • DERBY_HOME=”/usr/lib/jvm/jdk1.8.0_191/db”

Save Using ctrl x y

Step 4

Copy paste all the commands one by one

  • sudo update-alternatives –install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.8.0_191/bin/java” 0
  • sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/jvm/jdk1.8.0_191/bin/javac” 0
  • sudo update-alternatives –set java /usr/lib/jvm/jdk1.8.0_191/bin/java
  • sudo update-alternatives –set javac /usr/lib/jvm/jdk1.8.0_191/bin/javac

Step 5

  • update-alternatives –list java
  • update-alternatives –list javac
  • java -version


In this post i show how to install java openjdk 8 in kali linux which is required by many tools , like lemon rat and many more , hope you like my post dont’t forget subscribe my youtube channel. Create a forum here if you facing some error . 

Leave a Comment