I am trying to install Oracle JDK on ubuntu 18.04.
I am using the command sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-14.0.2/bin/java 1 but this command does nothing. But it works perfectly for javac.
Can anyone can throw some light on this?
Thanks!
01 Answer
Ater installing the new java, you would need to make it the java pointed to by /usr/bin/java, by typing
update-alternatives --config java
and then select the new java as the one to use. Apparently you did not previously have another version of javac installed, so the new javac was selected automatically...