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:  9+ Best Linux Screen Recorder On Ubuntu 20.04 LTS

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:  Ubuntu 20.04 LTS Available On Microsoft Store

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

Tutorial To Add Swap Space On Ubuntu 20.04 Tutorial To Add Swap Space On Ubuntu 20.04 Ubuntu 20.04
Install PostgreSQL On Ubuntu Linux Install PostgreSQL On Ubuntu Linux Ubuntu
Install ScanGear MP2, Cnijfilter2 & UFRII Drivers In Ubuntu 20.04 Via PPA. Install ScanGear MP2, Cnijfilter2 & UFRII Drivers In Ubuntu 20.04 Via PPA. Tools
Configure A Firewall On Ubuntu 20.04 With UFW Configure A Firewall On Ubuntu 20.04 With UFW Ubuntu 20.04
Multiple Ways To Upgrade Linux Kernel In Ubuntu 20.04 LTS Ubuntu 20.04.1 LTS Available Now Ubuntu 20.04
How To Download Ubuntu 20.04 LTS & Derivatives How To Download Ubuntu 20.04 LTS & Derivatives 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. Demand Writer (Costa Mesa)

    • Costa Mesa, CA
    • The Law Offices of Daniel Kim
    • Part Time
  • Technical Writer

    • Swiftwater, PA
    • Adecco
    • Full Time
  • Video Photojournalist

    • Washington DC
    • NTD
    • Full Time
  • Senior Technical Writer

    • Swiftwater, PA
    • Aequor
    • Full Time
  • Technical Writer II (Swiftwater)

    • Swiftwater, PA
    • HireTalent - Staffing & Recruiting Firm
    • Part Time
  • Service Writer

    • Richfield, OH
    • W.W. Williams
    • Full Time
  • Senior Data Scientist, Product, Google Play

    • Mountain View, CA (Remote)
    • Google
    • Full Time
  • Technical Writer

    • Pittsburgh, PA
    • The HIRD
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme