Use this tutorial to Install Java 13 on Ubuntu 19.04, 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 13 on Ubuntu
You need to enable additional repository to your system to install Java 10 on Ubuntu VPS. After that install Oracle Java 10 on an Ubuntu system using apt-get. This repository contains a package named oracle-java13-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 13 on Ubuntu and LinuxMint.
sudo add-apt-repository ppa:linuxuprising/java sudo apt update sudo apt-get install oracle-java13-installer
Step 2 – Verify Java Inatallation
The apt repository also provides package oracle-java13-set-default to set Java 13 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-java13-set-default
After successfully installing Oracle Java 13 using the above steps, Let’s verify the installed version using the following command.
java -version java version "13" 2019-09-17 Java(TM) SE Runtime Environment (build 13+33) Java HotSpot(TM) 64-Bit Server VM (build 13+33, 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-13-oracle export J2REDIR=/usr/lib/jvm/java-13-oracle export PATH=$PATH:/usr/lib/jvm/java-13-oracle/bin:/usr/lib/jvm/java-13-oracle/db/bin export JAVA_HOME=/usr/lib/jvm/java-13-oracle export DERBY_HOME=/usr/lib/jvm/java-13-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.