Use this tutorial to Install Java 14 on Ubuntu 19.10, 18.04 LTS, 16.04 LTS and LinuxMint 18 using PPA. Follow the below steps to Install Java on Ubuntu command line.
To install Java LTS release on your system follow below links:
- Read this => Install Java 11 on Ubuntu 18.04 (Bionic)
- Read this => Install Java 11 on Ubuntu 16.04 (Xenial)
Step 1 – Install Java 14 on Ubuntu
You need to enable additional repository to your system to install Java 10 on Ubuntu VPS. After that install Oracle Java 14 on an Ubuntu system using apt-get. This repository contains a package named oracle-java14-installer, Which is not an actual Java package. Instead of that, this package contains a script to install Java on Ubuntu.
Run below commands to install Java 14 on Ubuntu and LinuxMint.
sudo add-apt-repository ppa:linuxuprising/java sudo apt update sudo apt install oracle-java14-installer
Step 2 – Verify Java Inatallation
The apt repository also provides package oracle-java14-set-default to set Java 14 as your default Java version. This package will be installed along with Java installation. To make sure execute the below command.
sudo apt install oracle-java14-set-default
After successfully installing Oracle Java 14 using the above steps, Let’s verify the installed version using the following command.
java -version java version "14" 2020-03-17 Java(TM) SE Runtime Environment (build 14+36-1461) Java HotSpot(TM) 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)
Step 3 – Setup JAVA_HOME and JRE_HOME Variable
The installer script set the environment variable for you. You can find these variables in /etc/profile.d/jdk.sh script.
cat /etc/profile.d/jdk.sh export J2SDKDIR=/usr/lib/jvm/java-14-oracle export J2REDIR=/usr/lib/jvm/java-14-oracle export PATH=$PATH:/usr/lib/jvm/java-14-oracle/bin:/usr/lib/jvm/java-14-oracle/db/bin export JAVA_HOME=/usr/lib/jvm/java-14-oracle export DERBY_HOME=/usr/lib/jvm/java-14-oracle/db
All done, you have successfully installed Java 10 on a Linux system. You may also need to install Tomcat server to run your Java web application. Use our another tutorial to Install Tomcat 7 or Install Tomcat 8 or Install Tomcat 9 on Ubuntu, Debian, and LinuxMint systems.