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?
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.
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.
update-alternatives --installfirst, before you can config alternatives.