I'm on Ubuntu 18.04 with default-java -> java-1.11.0-openjdk-amd64/. java -version
shows:
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3, mixed mode)
I already did an apt upgrade
and apt-upgrade
, but the java version is still 10.
How can I safely upgrade my Java installation to JDK 11 GA? If I have to add a repository, which one should I use? Do I have to uninstall the existing JDK first?
How can I then make the new Java version the default-java?
To add the LinuxUprising Java PPA repository to your software sources and install Oracle Java 11 in Ubuntu 18.04 run the following commands:
The oracle-java11-installer package automatically installs the oracle-java11-set-default package, which sets Oracle Java 11 as default (including setting the JAVA_HOME environment variable, which requires a session restart).
You don't need to uninstall openjdk-11-jdk if you already have installed it. You can use
update-java-alternatives
(which is installed when openjdk-11-jdk is installed) to manually choose which Java to use before running an application.