Skip to content
Technology News Information & Jobs

Technology News Information & Jobs

Ubuntu Tutorials, Ubuntu How To , Linux Tips, Tech Jobs

  • Work with US
  • Search Jobs
  • Post a Job
  • Contact Us
  • Ubuntu
    • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Themes
  • Linux
  • Laptops
  • Tutorials
  • Job Dashboard
  • Toggle search form
Install Java On Ubuntu 20.04 LTS

Install Java On Ubuntu 20.04 LTS

Posted on May 8, 2020 By admin

Tutorial To install JAVA On Ubuntu 20.04 LTS

We will install JAVA, JRE, and JDK in this tutorial post. We hope you know the differences between JRE and JDK.

JDK: Java Development Kit or JDK  is a development environment that is used for developing Java Applications.

JRE: JAVA Runtime Environment or JRE is for running Java applications. It is a part of JDK.

Install Java on Ubuntu 20.04 LTS

Install OpenJDK or Oracle Java as per your requirement.

Install OpenJDK In Ubuntu 20.04 LTS

First, update the repository index.

sudo apt update

Install OpenJDK JDK In Ubuntu 20.04 LTS

JDK ( Default JDK 11)

sudo apt install -y default-jdk

Java JDK 11

sudo apt install -y openjdk-11-jdk

Java JDK 8

sudo apt install -y openjdk-8-jdk
JDK Headless

Default JDK ie JDK 11

sudo apt install -y default-jdk-headless

Java JDK 11

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

Java JDK 8

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

Install OpenJDK JRE

JRE

Default JRE ie JRE 11

 sudo apt install -y default-jre

Java JRE 11

sudo apt install -y openjdk-11-jre

Java JRE 8

sudo apt install -y openjdk-8-jre
JRE Headless

Default JRE ie JRE 11

sudo apt install -y default-jre-headless

Java JRE 11 ###

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

Java JRE 8

sudo apt install -y openjdk-8-jre-headless

Install Oracle Java In Ubuntu 20.04 LTS

There is no separate Java Runtime Environment as  Oracle JDK v9.x and above now includes JRE as well.

READ More Relevant Stuff:  List Of Useful Apps For Ubuntu 20.04 LTS [For Beginner]

Download Oracle Java JDK

You can use either the command line or browser to download the JDK in Ubuntu 20.04 LTS.

Go to the Oracle JDK and download the .deb package for the easy installation.

Download Oracle Java JDK 14

Oracle Java JDK 11 (LTS)

Oracle Java JDK 8

In an alternative method, you can download and install Oracle JAVA via command line:

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/14.0.1+7/664493ef4a6946b186ff29eb326336a2/jdk-14.0.1_linux-x64_bin.deb

Install Oracle Java JDK In Ubuntu 20.04 LTS using the apt command.

For Oracle Java JDK 14

sudo apt install -y ./jdk-14.0.1_linux-x64_bin.deb

For Oracle Java JDK 11 (LTS)

sudo apt install -y ./jdk-11.0.7_linux-x64_bin.deb

For Oracle Java JDK 8

sudo tar -zxvf jdk-8u251-linux-x64.tar.gz -C /usr/lib/jvm/

By default, If you install Oracle JDK via .deb package then it will be installed in /usr/lib/jvm directory

Create a symbolic link for Java with Oracle JDK.

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-14.0.1/bin/java 1

Run the update-alternatives command to set the default java version. You will see multiple options if you have different versions installed in your system:

sudo update-alternatives --config java

Run the following command to verify your JAVA version.

java -version

Setup Environmental Variables In Ubuntu 20.04 LTS

You can create a file in /etc/profile.d directory to place the variables for your users.

sudo nano /etc/profile.d/java.sh

Now, change the variables path based on the Java location in your Ubuntu 20.04 LTS.

export PATH=$PATH:/usr/lib/jvm/java-11-openjdk-amd64/bin/
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
export J2SDKDIR=/usr/lib/jvm/java-11-openjdk-amd64/

Load the environments with the following command:

source /etc/profile.d/java.sh

If you want to set the environment variables for a particular user, you need to place the above variables in the following file.

READ More Relevant Stuff:  How To Check Your Ubuntu Version

~/.bash_profile file.

Ubuntu 20.04 Tags:JAVA, JDK Ubuntu, JRE, ubuntu 20.04 lts

Post navigation

Previous Post: Install ScanGear MP2, Cnijfilter2 & UFRII Drivers In Ubuntu 20.04 Via PPA.
Next Post: Downgrade Packages On Linux System: Linux Guide 2022

Related Posts

How To Restart Ubuntu Server How To Restart Ubuntu Server Ubuntu
How To Install aaPanel On Ubuntu | cPanel Alternative How To Install aaPanel On Ubuntu 22.04 LTS | cPanel Alternative Ubuntu 20.04
How To Install Nvidia Drivers On Ubuntu 22.04 LTS How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast Ubuntu
Configure CTRL+ALT+DEL As Task Manager In Ubuntu 20.04/18.04 Configure CTRL+ALT+DEL As Task Manager In Ubuntu 20.04/18.04 How To Ubuntu
How To Install Microsoft Teams On Ubuntu 22.04 LTS And Other Linux How To Install Microsoft Teams On Ubuntu 22.04 LTS And Other Linux Linux
How To Install SoftMaker Office 2021 In Ubuntu 20.04 LTS How To Install SoftMaker Office 2021 In Ubuntu 20.04 LTS Ubuntu 20.04

Recent Posts

  • New Job Search October 10, 2025
  • How To Enable Hibernate in Ubuntu 22.04 LTS May 20, 2024
  • Popular Ubuntu Games: Top 5 Games To Play March 17, 2024
  • WordPress | Your site doesn’t include support for the “generateblocks/container” block GenerateBlocks Plugin February 11, 2024
  • Ubuntu Autoremove Command Debian Autoremove Command February 10, 2024
  • How To Mount Windows 11 Shares on Debian Linux December 7, 2023
  • Anonymous Browsing 101: A Deep Dive Into Residential Proxies November 20, 2023
  • How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast October 31, 2023
  • Ethical Web Design: The Dos and Don’ts October 28, 2023
  • Understanding the Role of Security Operations Center October 25, 2023
  • The Positive Effects of AI Tools and Online Services on Students Successful Essay-Writing Skills October 3, 2023

Categories

  • Android
  • Apple
  • Blogs
  • Debian
  • Fix
  • Gadgets
  • Game
  • Google
  • How To Ubuntu
  • Internet
  • Laptops
  • Linux
  • Linux Commands
  • Linux Game
  • Linux Mint
  • News
  • Operating Systems
  • Security
  • Technology
  • Themes
  • Tools
  • Tutorials
  • Ubuntu
  • ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Windows 11
  • Wordpress
  • Search Jobs
  • Post a Job
  • Job Dashboard
  • Contact Us
  • About US
  • Cookie Policy
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
  • Write For US

Tags

android apps centos ChatGPT command Commands Debian deepin Desktop docker Fedora fix game games Gaming gnome google kernel linux linux commands linux kernel Linux laptops Linux Mint Linux themes minecraft NVIDIA Python Raspberry Pi sysadmin themes ubuntu ubuntu 18.04 Ubuntu 18.04 LTS Ubuntu 20.04 ubuntu 20.04 lts Ubuntu 22.04 LTS Ubuntu games Ubuntu kernel ubuntu themes ubuntu tutorial VirtualBox Windows Windows 11 Wine WSL
itsubuntu.com is an Equal Opportunity Employer. For Advertisement, Jobs, Guest posts, and any other thoughts, email us at [email protected]
  • Business Analyst / Technical Writer – Secure Cloud

    • Houston, TX
    • Capgemini Government Solutions
    • Full Time
  • Technical Writer

    • Annapolis, MD
    • CACI International, Inc.
    • Full Time
  • Freelance Writer – Work From Home

    • Arizona
    • Freelance
  • Staff Writer (DC/MD/VA)

    • Fairfax, VA
    • Govcio LLC
    • Full Time
  • Writer

    • Bethlehem, PA
    • Lehigh University
    • Full Time
  • Principal DSX Data Scientist

    • South San Francisco, CA (Remote)
    • Disability Solutions
    • Full Time
  • Digital Writer

    • Portland, OR
    • 24 Seven Talent
    • Part Time
  • Technical Writer (Facilities)

    • Raritan, NJ
    • Insight Global
    • Part Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme