How To Install openjdk-11-jdk-headless on Ubuntu 20.04

In this tutorial we learn how to install openjdk-11-jdk-headless on Ubuntu 20.04. openjdk-11-jdk-headless is OpenJDK Development Kit (JDK) (headless) OpenJDK Development Kit (JDK) (headless)

Introduction

In this tutorial we learn how to install openjdk-11-jdk-headless on Ubuntu 20.04.

What is openjdk-11-jdk-headless

openjdk-11-jdk-headless is:

OpenJDK is a development environment for building applications, applets, and components using the Java programming language.

Package: openjdk-11-jdk-headless Architecture: amd64 Version: 11.0.7+10-3ubuntu1 Multi-Arch: same Priority: optional Section: java Source: openjdk-lts Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: OpenJDK Team [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 221562 Provides: java-compiler, java-sdk-headless, java10-sdk-headless, java11-sdk-headless, java2-sdk-headless, java5-sdk-headless, java6-sdk-headless, java7-sdk-headless, java8-sdk-headless, java9-sdk-headless Depends: openjdk-11-jre-headless (= 11.0.7+10-3ubuntu1), libc6 (>= 2.2.5) Suggests: openjdk-11-demo, openjdk-11-source Conflicts: openjdk-11-jre-headless (« 11~19-2) Replaces: openjdk-11-jre-headless (« 11~19-2) Filename: pool/main/o/openjdk-lts/openjdk-11-jdk-headless_11.0.7+10-3ubuntu1_amd64.deb Size: 217058068 MD5sum: 65112303b54441026fef7f0b28cfa2ac SHA1: 018b37e312a830948f1c5e08a0b6b82d26576b95 SHA256: ddc10c6b593ef70e5e7c7d8d512695c31539690557b5d0626a36935069e137b2 Homepage: http://openjdk.java.net/ Description-en: OpenJDK Development Kit (JDK) (headless) OpenJDK is a development environment for building applications, applets, and components using the Java programming language.

There are three methods to install openjdk-11-jdk-headless on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install openjdk-11-jdk-headless Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install openjdk-11-jdk-headless using apt-get by running the following command:

sudo apt-get -y install openjdk-11-jdk-headless

Install openjdk-11-jdk-headless Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install openjdk-11-jdk-headless using apt by running the following command:

sudo apt -y install openjdk-11-jdk-headless

Install openjdk-11-jdk-headless Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install openjdk-11-jdk-headless using aptitude by running the following command:

sudo aptitude -y install openjdk-11-jdk-headless

How To Uninstall openjdk-11-jdk-headless on Ubuntu 20.04

To uninstall only the openjdk-11-jdk-headless package we can use the following command:

sudo apt-get remove openjdk-11-jdk-headless

Uninstall openjdk-11-jdk-headless And Its Dependencies

To uninstall openjdk-11-jdk-headless and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove openjdk-11-jdk-headless

Remove openjdk-11-jdk-headless Configurations and Data

To remove openjdk-11-jdk-headless configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge openjdk-11-jdk-headless

Remove openjdk-11-jdk-headless configuration, data, and all of its dependencies

We can use the following command to remove openjdk-11-jdk-headless configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge openjdk-11-jdk-headless

References

Summary

In this tutorial we learn how to install openjdk-11-jdk-headless package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.