Menu
User

DropVPS Team

Writer: John hens

how install java on kali linux 2025

how install java on kali linux 2025

Publication Date

09/17/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Java remains one of the most widely used programming languages and runtime environments, and many penetration testing tools in Kali Linux depend on it. Whether you need the Java Runtime Environment (JRE) to run applications or the Java Development Kit (JDK) to compile code, having the latest Java setup on Kali Linux 2025 ensures smooth performance. 

Step 1: Update Kali Linux Packages

Keeping your system updated ensures you get the latest Java version available in the Kali repositories. Open your terminal and run:  

sudo apt update 
sudo apt upgrade -y

Step 2: Install the Java Runtime Environment (JRE)

if your main purpose is to run Java-based applications or penetration testing tools, the JRE is all you need. It provides the runtime libraries without the developer tools:

sudo apt install default-jre -y

Step 3: Install the Java Development Kit (JDK)

For compiling Java programs, building projects, or running advanced tools, you also need the JDK. It includes both the JRE and the compiler (javac):

sudo apt install default-jdk -y

Installing the JDK ensures you’re ready for development and advanced use cases.

Step 4: Verify Java Installation

After installing Java, confirm that everything works correctly. You can check both the runtime and compiler versions with these commands:

java -version
javac -version

If both return a version number, Java is successfully installed on your Kali Linux system.

Optional Step: Set JAVA_HOME Environment Variable

Some applications require the JAVA_HOME environment variable. First, find the installation path:

readlink -f $(which java)

Then export it (replace the path with your actual Java directory):

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64

To make this change permanent, add the line to your ~/.bashrc or ~/.zshrc file.

Linux VPS
U
Loading...

Related Posts