0

I downloaded jdk-13.0.2_linux-x64_bin.deb from oracle and installed using dpkg. However,

update-alternatives --config java

doesnt show java13. How do i get the java -version to java13 now?

2

2 Answers 2

3

Install the OpenJDK 13 packages available in Kali:

sudo apt install openjdk-13-jdk

OpenJDK 14 is also available:

sudo apt install openjdk-14-jdk

Since (from comments) you’re currently using Java 11, you should review the release notes and migration guides for the successive versions: Java 12, Java 13, Java 14.

Java 11 is the current LTS, it will be maintained for a number of years; releases 12 through 15 are non-LTS releases, so they are only maintained for six months.

0
0

Although it's answered, I'll give you another answer in case you need Oracle/Sun Java (some applications may work only with it, not openjdk).

Download the generic Linux .tar jdk from Oracle, not .deb specific for Debian. Untar to a path, for example /opt/SunJava. (I kept Sun in the path, I had it like this before it was taken over by oracle).

in your profile add these lines:
export JAVA_HOME=/opt/SunJava/
export JRE_HOME=/opt/SunJava/jre/
export PATH=$PATH:$JAVA_HOME/bin

sudo update-alternatives --install /usr/bin/java java /opt/SunJavaCurrent/bin/java 100

sudo update-alternatives --install /usr/bin/javac javac /opt/SunJavaCurrent/bin/javac 100

update-alternatives --display java
update-alternatives --display javac

sudo update-alternatives --config java
sudo update-alternatives --config javac

That way you can have Oracle/Sun JDK available and able to choose between OpenJDK and OracleJDK. You can also use alternatives to have many different versions of java available. Or you can achieve this using softlinks, ln -s.

3
  • Awesome. Exporting path is awesome. However its long but good. Commented Jun 23, 2020 at 15:40
  • Please don’t continue speading the old stories about Oracle / OpenJDK incompatibility. Since version 11, both are functionally identical, according to Oracle themselves. Commented Jun 23, 2020 at 16:27
  • As you said, since version 11. Many enterprises are still developing on ver 1.8 or even 1.7. It's not easy for every developer to upgrade her applications on the newer platform. Personally I have seven Java versions (even one from IBM!) in total on my debian pc due to incompatibilites between production apps on the companies I run projects for. Commented Jun 23, 2020 at 20:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.