I downloaded .deb file for JDK11 from https://www.oracle.com/java/technologies/javase-jdk11-downloads.html. After installation (ubuntu 18.04) when I run update-alternatives --config java
, I don't see the newly installed jdk in the list.
There is 1 choice for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 auto mode
* 1 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode
ls -l /usr/bin/java
produces /etc/alternatives/java
and the java in /etc/alternatives/ folder liks to java -> /usr/lib/jvm/java-8-oracle/jre/bin/java
I would like to switch between java8 and java11. Is it possible to fix this without breaking the java-8-oracle installation?
whereis -b java
doesn't include JDK11 then it is not in your$PATH
and it won't show as a result. You can add to the path like in the answers to this question. There's a brief explanation of update-alternatives in the answer to this question along with a recommendation to trygalternatives
to manage alternatives from a GUI in an answer below that. The answers here mentionupdate-java-alternatives
which also may help. – l3l_aze Jul 21 '20 at 02:33