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:  Install MATE Desktop Environment 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:  How To Install Papirus Icon Theme on Ubuntu 20.04 & Derivatives

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

Ubuntu Studio Switching To KDE Plasma Desktop Ubuntu Studio Switching To KDE Plasma Desktop Linux
How To Install aaPanel On Ubuntu | cPanel Alternative How To Install aaPanel On Ubuntu 22.04 LTS | cPanel Alternative Ubuntu 20.04
Install Mate Desktop On Ubuntu 20.04 LTS Install MATE Desktop Environment On Ubuntu 20.04 LTS Themes
How To Set Up Automatic Updates On Ubuntu 22.04 LTS How To Set Up Automatic Updates On Ubuntu 22.04 LTS Tutorials
Downgrade Packages On Linux System: Linux Guide 2020 Downgrade Packages On Linux System: Linux Guide 2022 Linux
Upgrade To Ubuntu 20.04 LTS : From Ubuntu 18.04 LTS, Ubuntu 19.10 Upgrade To Ubuntu 20.04 LTS : From Ubuntu 18.04 LTS,Ubuntu 19.10 Linux

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]
  • Electrical Engineer

    • Memphis, TN
    • JABIL CIRCUIT
    • Full Time
  • Senior Lead AI Engineer (Gen AI Platform Services)

    • New York, NY
    • Capital One Bank
    • Full Time
  • Grant Writer

    • Chicago, IL
    • Marillac Social Center
    • Full Time
  • UX Writer

    • Cambridge, MA
    • Amazon
    • Full Time
  • Data Engineer / Business Intelligence Engineer

    • Dallas, TX (Remote)
    • Barbri
    • Full Time
  • Customs Entry Writer (Contract)

    • Wayne, NJ
    • Manpower
    • Full Time
  • Senior Lead AI Engineer (SDKs)

    • Norfolk, VA
    • Capital One Bank
    • Full Time
  • Computer Architecture & Systems Fundamentals Job Training Program

    • Boston, MA
    • Year Up United
    • Internship

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme