Thursday , July 29 2021
Installing & Configuring Latest Oracle Java with Kali (Currently 2021.1) java logo 1

Installing & Configuring Latest Oracle Java with Kali (Currently 2021.1)

Creating this post to keep track of how I successfully installed and configured Oracle Java JDK (current latest version: 16.01) on my Kali Linux distribution (current latest version: 2021.1).

Java JDK Download official URL

Prerequisite: Install GDEBI, Not necessary though. But I usually install applications with gdebi:

# sudo apt-get install gdebi

Purge OpenJDK

# sudo apt-get purge openjdk-\*

Install Oracle JDK

# gdebi jdk-16.0.1_linux-x64_bin.deb

Installation Complete.

Configure Oracle Java as default:Tell the system that there’s a new Java version available:

Tell the system that there’s a new Java version available:

# sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_version/bin/java" 1

In my case:

# sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-16.0.1/bin/java" 1

Note: If updating from a previous version that was removed manually, execute the above command twice, because you’ll get an error message the first time.

Set the new Oracle JDK as the default:

# sudo update-alternatives --set java /usr/lib/jvm/jdk-16.0.1/bin/java

Verify the version of the JRE or JDK:

# java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

Set .JAR files to Open with JAVA with a Double-Click

Adding a file called /usr/share/applications/java.desktop with following content will do the trick.

First Create & Open the java.desktop file:

# nano /usr/share/applications/java.desktop

Add following content in this file and SAVE:

[Desktop Entry]
Exec=java -jar %f

After adding this file you should be able to find an entry called Java in the Open file with… Dialog


This post is based on content from below pages:

About Muhammad Attique

Check these out :)

How to Install & Configure Google Chrome on Kali Linux

In this blog post, I’m going to demonstrate step by step how to install & …

Leave a Reply

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.