Running applications on Kali can sometimes be rather difficult in combination with Java.  To control the active version of Java, try the following:

First, check the current version of Java:

# java -version

openjdk version “1.8.0_162”
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)

With the next command, you can change the Java version:

# update-alternatives –config java

There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
0 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 auto mode
* 1 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
2 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 manual mode

Press <enter> to keep the current choice[*], or type selection number:

Enter the number of the desired Java version and it will be active, for example zero. The Java version will be openjdk9:

update-alternatives: using /usr/lib/jvm/java-9-openjdk-amd64/bin/java to provide /usr/bin/java (java) in auto mode

# java -version

openjdk version “9.0.4”
OpenJDK Runtime Environment (build 9.0.4+12-Debian-4)
OpenJDK 64-Bit Server VM (build 9.0.4+12-Debian-4, mixed mode)

 

Sources:

https://www.mkyong.com/linux/debian-change-default-java-version/

https://forums.kali.org/showthread.php?41-Installing-Java-on-Kali-Linux

 

 

Leave a Reply

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