Install Java on Kali Linux
To install the Java Development Kit (JDK) on Kali Linux, you can use the following steps.
Update Package List
sudo apt update -y
Kali Linux usually comes with OpenJDK available in its repositories. You can install it using the following commands.
Install default version:
sudo apt install default-jdk -y
Install specific version:
# Available versions
sudo apt-cache search openjdk
# Search for specific version
sudo apt-cache search openjdk | grep 21
sudo apt install openjdk-11-jdk -y # version 11
sudo apt install openjdk-17-jdk -y # version 17
sudo apt install openjdk-21-jdk -y # version 21
You can verify that Java has been installed by checking the version:
Additionally, you may want to check the Java Compiler version:
If the installation was successful, you should see information about the installed Java version.
Md Obydullah is a software engineer and full stack developer specialist at Laravel, Django, Vue.js, Node.js, Android, Linux Server, and Ethichal Hacking.