How to install Java (JDK and JRE) on Ubuntu 21.04 (Hirsute Hippo)

How to install Java (JDK and JRE) on Ubuntu 21.04 (Hirsute Hippo)

First, check that Java is installed on your Ubuntu system using the following command:

java –version

If Java is already installed on your Ubuntu system, then you can get output like:

Install Java JDK 11 (Ubuntu 21.04 (Hirsute Hippo) Default)
If Java is not installed on your Ubuntu 21.04 then run this command to install the Java JDK.

sudo apt install default-jdk
or

sudo apt install openjdk-11-jdk

 

Install Java JRE on Ubuntu 21.04
you want to install only JRE on your Ubuntu 21.04 then run this command you can install it on your system:

sudo apt install default-jre
Or

sudo apt install openjdk-11-jre

Leave a Comment

Your email address will not be published. Required fields are marked *