Inside a Debian 10 VM I have first installed OpenJDK 11, and it was all OK.
Then I have installed Oracle JDK 13 according to instructions posted in Computing for geeks, that means wget-ting the .deb file and install it with dpkg -i.
I have got no errors, but when running update-alternatives --config java I get this answer:
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/javaWhy? How can I switch from one JDK to the other?
1 Answer
The alternatives are handled by pre- and post-install hooks. There seems to be no hook included in the package you downloaded, but you can easily add an alternative manually:
# update-alternatives --install /usr/bin/java java /path/to/OracleJDKs/java 2
# update-alternatives --install /usr/bin/javac javac /path/to/OracleJDKs/javac 2Afterwards you should be able to select a Java version by running update-alternatives --config java and update-alternatives --config javac.
However, the java-package package always provided an easy way to install Oracle JDK on a Debian system. Since I have not used it for quiet a while I can not say if it is still compatible with current Java releases.