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 No Comments on Install Java On Ubuntu 20.04 LTS

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:  3D Arcade Racer SuperTuxKart 1.2 Released: Install It On Ubuntu

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 Set JAVA_HOME Environment Variable On Ubuntu 22.04

~/.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

Awesome CCleaner Alternatives For Ubuntu 20.04 LTS Awesome CCleaner Alternatives For Ubuntu 20.04 LTS Ubuntu
Downgrade Packages On Linux System: Linux Guide 2020 Downgrade Packages On Linux System: Linux Guide 2022 Linux
Configure Universe, Multiverse And Restricted repo On Ubuntu 20.04 LTS Configure Universe, Multiverse And Restricted repo On Ubuntu 20.04 LTS Linux Commands
Ubuntu 16.04.7 LTS And Ubuntu 18.04.5 LTS Point Version Released Ubuntu
Top Android Emulators For Linux : Run Android Apps on Linux Top Android Emulators For Linux : Run Android Apps on Linux [2023] Linux
Ubuntu 20.10 Groovy Gorilla Reaches End Of Life On July 22nd, 2021 Ubuntu 20.04

Leave a Reply Cancel reply

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

Recent Posts

  • 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
  • Linux Wget Examples September 27, 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]
  • Sr. Data Scientist / AI-ML Engineer (10+ Years)

    • Westerville, OH (Remote)
    • Arthur Grand Technologies
    • Temporary
  • Technical Writer – ACTIVE SECRET

    • Elkridge, MD
    • Monster
    • Full Time
  • Xactimate Construction Estimate Writer – Insurance Restoration

    • Houston, TX
    • IICRC
    • Full Time
  • SAP Technical writer – S/4HANA Project Support

    • Sacramento, CA
    • Monster
    • Full Time
  • Technical Writer with SAP exp

    • Rancho Cordova, CA
    • Monster
    • Full Time
  • Technical Writer

    • San Diego, CA
    • Monster
    • Full Time
  • Title Policy Writer (Orem)

    • Orem, UT
    • Insight Global
    • Part Time
  • Business Process Analyst / Technical Writer (Remote)

    • Stafford, VA
    • Oxley Enterprises Inc
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme