Install Zulu OpenJDK Version 11 on Ubuntu 20.04/18.04/16.04 LTS

In this article, We are going to perform How to Install Zulu OpenJDK Version 11 on Ubuntu 20.04/18.04/16.04 LTS

Introduction

Zulu is free and open source community distributions for OpenJDK. It has Zulu OpenJDK 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15 EA which support for Linux, Windows, Solaris , Mac OS, etc., OS types.

Prerequisites

  • Ubuntu Server 20.04/18.04/16.04 LTS
  • SSH access with sudo privileges

Step #1: Import the Zulu Repository Key for Ubuntu

First add the Zulu Repository Key for Ubuntu using below commands,

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9

Output:

Executing: /tmp/apt-key-gpghome.PgxUnr6sbZ/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9

gpg: key B1998361219BD9C9: public key "Azul Systems, Inc. (Package signing key.) <[email protected]>" imported

gpg: Total number processed: 1

gpg: imported: 1

Step #2: Add Zulu apt Repository

Next add Zulu apt Repository using below command

sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'

update the system package

sudo apt update

Step #3: Install Zulu OpenJDK Version 11 on Ubuntu

Now Install Zulu OpenJDK Version 11 on Ubuntu

sudo apt install zulu-11

if you want to install specific version of Zulu OpenJDK use below command

$ sudo apt install zulu-<Version>

Step #4: Verify Java Version

To check the Installed Zulu java version
java -version
Output:
openjdk version "11.0.7" 2020-04-14 LTS

OpenJDK Runtime Environment Zulu11.39+15-CA (build 11.0.7+10-LTS)

OpenJDK 64-Bit Server VM Zulu11.39+15-CA (build 11.0.7+10-LTS, mixed mode)

Step #5: Setting the JAVA_HOME Environment Variables for Zulu OpenJDK Version 11

To define the environment variable open the below file:
sudo nano /etc/environment
Paste the below variable into the file:

For Zulu OpenJDK 11 version Java is installed at /usr/lib/jvm/zulu-11-amd64 location

/etc/environment
JAVA_HOME="/usr/lib/jvm/zulu-11-amd64"

Load the environment variable using below command

source /etc/environment

Lets verify JAVA_HOME variable

echo $JAVA_HOME

Output:

/usr/lib/jvm/zulu-11-amd64

If you seeing output like above then we have successfully set up the Java Home on Ubuntu, Setting the JAVA_HOME Environment Variables for Zulu OpenJDK Version 11.

Conclusion:

In this article, We have covered How to Install Zulu OpenJDK Version 11 on Ubuntu 20.04 LTS

Related Articles:

How to Install Java on Ubuntu 20.04 LTS

How to Install Gradle on Ubuntu 20.04/18.04/16.04 LTS

Reference

Zulu OpenJDK Official page

Aniruddha Kanade

I am Shivdas Kanade working as Senior Site Reliability Engineer (Cloud and DevOps ). Believes in Sharing Knowledge.

6 thoughts on “Install Zulu OpenJDK Version 11 on Ubuntu 20.04/18.04/16.04 LTS”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap