

In the above example we are using Java 11. JAVA_HOME is a common one so we will now we add this.Įdit /etc/environment file: $ sudo nano /etc/environmentĪdd the following line to the file and save: JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/bin/" Java applications may use environment variables.
#JRE DOWNLOAD UBUNTU 14.04 MANUAL#
* 0 /usr/lib/jvm/java-14-openjdk-amd64/bin/javac 1411 auto modeġ /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1111 manual modeĢ /usr/lib/jvm/java-13-openjdk-amd64/bin/javac 1311 manual modeģ /usr/lib/jvm/java-14-openjdk-amd64/bin/javac 1411 manual modeĤ /usr/lib/jvm/java-8-openjdk-amd64/bin/javac 1081 manual modeĪgain, you can now switch to another JDK or keep the current version. The response will look like: There are 4 choices for the alternative javac (providing /usr/bin/javac). Switch JDK versionĬheck installed JDKs: $ sudo update-alternatives -config javac Now you can switch to another JRE or keep the current version. Press to keep the current choice, or type selection number: * 0 /usr/lib/jvm/java-14-openjdk-amd64/bin/java 1411 auto modeġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual modeĢ /usr/lib/jvm/java-13-openjdk-amd64/bin/java 1311 manual modeģ /usr/lib/jvm/java-14-openjdk-amd64/bin/java 1411 manual modeĤ /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode The response will look like: There are 4 choices for the alternative java (providing /usr/bin/java). Switch JRE versionĬheck installed JREs: $ sudo update-alternatives -config java 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"
#JRE DOWNLOAD UBUNTU 14.04 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. You may need to work with various versions of Java Runtime Environents (JRE) and Java Development Kits (JDK).
