
Now that we have installed multiple Java JRE/JDK versions we can switch between them. The response will look like: javac 14.0.2Īgain, we can see the current JRE and JDK are version 14. OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing) The response will look like: openjdk version "14.0.2"
#Install java 8 on ubuntu install#
Install Java 14 JDK: $ sudo apt install openjdk-14-jdk

The response will look like: javac 13.0.4Īs you can see the current JRE and JDK are version 13. OpenJDK 64-Bit Server VM (build 13.0.4+8-Ubuntu-120.04, mixed mode)Ĭheck current JDK version: $ javac -version OpenJDK Runtime Environment (build 13.0.4+8-Ubuntu-120.04) The response will look like: openjdk version "13.0.4" Install Java 13 JDK: $ sudo apt install openjdk-13-jdkĬheck current JRE version: $ java -version If you check current JDK and JRE versions it will still display Java 11. Install Java 8 JDK: $ sudo apt install openjdk-8-jdk The response will look like: javac 11.0.9 2. OpenJDK 64-Bit Server VM (build 11.0.9+11-Ubuntu-0ubuntu1.20.04, mixed mode, sharing) OpenJDK Runtime Environment (build 11.0.9+11-Ubuntu-0ubuntu1.20.04) The response will look like: openjdk version "11.0.9" Install Java 11 JDK: $ sudo apt install default-jdk Installing a JDK package will also install the corresponding JRE. It is the default Java development and runtime version. Install Java 11 JRE/JDKĪt the time of writing, Java 11 is the latest long-term supported (LTS) version of Java. Sudo apt install openjdk-8-jdk-headless # version 8u265-b01-0ubuntu2~20.04Īs you can see, the terminal response displays the commands to install various headless JDK versions. Sudo apt install default-jdk # version 2:1.11-72, or If you do not have a Java JDK installed the terminal response will look like: Command 'javac' not found, but can be installed with:

Open a terminal and check java JDK version: $ javac -version When the java application does not use a graphical user interface the headless version can be used. for JDK 11 choose from openjdk-11-jdk-headless and openjdk-11. In this article, we are going to run through the installation and management of JREs/JDKs.

I get the following error Err:1 groovy-updates/universe amd64 openjdk-8-jre-headless amd64 8u292-b10-0ubuntu1~20.You may need to work with various versions of Java Runtime Environents (JRE) and Java Development Kits (JDK). If I try to do install it with the command sudo apt install openjdk-8-jre-headless Sudo apt install openjdk-14-jre-headless # version 14.0.2+12-1 Sudo apt install openjdk-8-jre-headless # version 8u292-b10-0ubuntu1~20.10 Sudo apt install openjdk-13-jre-headless # version 13.0.7+5-0ubuntu1~20.10 Sudo apt install default-jre # version 2:1.11-72, or java -versionĬommand 'java' not found, but can be installed with: I have a machine with a version of Ubuntu 20.10 installed.
