3

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?

Wasim Aftab
  • 169
  • 6
  • If the output of `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](https://askubuntu.com/q/60218/411468). There's a brief explanation of update-alternatives in the answer to [this question](https://askubuntu.com/q/233190/411468) along with a recommendation to try `galternatives` to manage alternatives from a GUI in an answer below that. [The answers here](https://askubuntu.com/q/315646/411468) mention `update-java-alternatives` which also may help. – l3l_aze Jul 21 '20 at 02:33

0 Answers0