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

 

 

8 Replies to “Change active java version in Kali”

  1. Hey are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and create my own. Do you require any coding expertise to make your own blog? Any help would be really appreciated!

  2. Hi are using WordPress for your site platform?
    I’m new to the blog world but I’m trying to get started and create my own. Do you need any
    html coding knowledge to make your own blog? Any help
    would be greatly appreciated!

  3. Thanks for every other excellent article. The place else
    could anyone get that type of info in such a perfect way of writing?
    I’ve a presentation subsequent week, and I am at the look for such information.

  4. Hey there would you mind letting me know which web host you’re working with?
    I’ve loaded your blog in 3 different internet browsers
    and I must say this blog loads a lot faster then most. Can you suggest a
    good hosting provider at a fair price? Kudos, I appreciate it!

  5. I really like what you guys are up too. This sort of clever work and exposure!
    Keep up the amazing works guys I’ve added you guys to blogroll.

Leave a Reply to a coconut oil Cancel reply

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