How to set default Java version on Ubuntu / Debian Method 2: Manually install OpenJDK 11 on Ubuntu 22.04|20.04|18.04
If you have more than one version of Java installed in your system, you can refer to our guide on how to set default version for all applications. OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing) Setting Default version of Java OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1) If you don’t want to set Java 11 as default, then install: sudo apt install oracle-java11-installer Sudo apt install oracle-java11-set-default Ubuntu 18.04 sudo add-apt-repository ppa:linuxuprising/java Method 1: Install Oracle Java 11 from Upstream repo / PPA – Recommendedįor Ubuntu 22.04/20.04, run: sudo apt update