• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to install Java (OpenJDK) on Ubuntu Linux

June 23, 2020 by Sharad Chhetri

Java is a class based, object oriented programming language. It is cross platform and widely use in developing applications. The Java was first developed in Sun Microsystem (Now acquired by Oracle).

In this post, to install Java we will use the OpenJDK package. OpenJDK is a free and open source product implements Java SE which is currently manage by Oracle Developers. It was actually initiated by Sun Microsystem.

Java comes with three editions, these are –
1. Java SE (Standard Edition)
2. Java EE (Enterprise Edition)
3. Java ME (Micro Edition)

Difference between JDK and JRE

JDK (Java Development Kit) is used for development purpose, it has libraries, development tools ,debugging tools and private JVM.
JRE (Java Runtime Environment) is require to run Java programmes only.

Install Java (OpenJDK) on Ubuntu

We have inline the steps which are generic in all Ubuntu version. Only thing you have to do is just read this post carefully and apply.

Search available OpenJDK packages in apt repo

First we will search in our Ubuntu system how many OpenJDK version is available in Ubuntu repositories.

sudo apt -y update
sudo apt search openjdk*

After running above command, it will show N number of package list. Just read the output and find the desirable package which you want to install.

Watch this video, it will show how to search OpenJDK packages in Ubuntu.

https://sharadchhetri.com/wp-content/uploads/2020/06/apt-search.webm

Install OpenJDK

To install any package in Ubuntu through apt command is very simple.

Syntax:

sudo apt install <\package-name\>

Similarly to install OpenJDK we will use the apt command as described in above syntax. You can see in video which we have posted in this article, we can find the OpenJDK version list by searching through apt search package-name command.

Install OpenJDK-14
At the time of writing this post, OpenJDK-14 was latest stable version.

sudo apt install openjdk-14-jdk openjdk-14-jre

Similarly you can install other OpenJDK version in same manner.

Install OpenJDK-13

sudo apt install openjdk-13-jdk openjdk-13-jre

Install OpenJDK-11

sudo apt install openjdk-11-jdk openjdk-11-jre

Install OpenJDK-8

sudo apt install openjdk-8-jdk openjdk-8-jre

Set the default Java

When you have multiple Java packages in system, you can select the desired Java version by using following command.

sudo update-alternatives --config java

update-alternatives

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Install and set Java on Ubuntu 14.04 LTS with tar ball file
  2. How to set JAVA environment variables in Linux
  3. How to add/install Ubuntu fonts in CentOS/Red Hat Linux
  4. Install and upgrade to latest Git version on Ubuntu/Debian/Linux Mint
  5. how to install terraform in Linux : CentOS-Ubuntu
  6. Recover Linux Grub Password in linux rescue mode CentOS/Red Hat
  7. How to upgrade Linux Mint 15 to Linux Mint 16
  8. make command not found in linux CentOS Red Hat ubuntu Debian
  9. Ubuntu Linux : get matrix effect on terminal
  10. How to install Magento 1.7.0.2 in linux, bug issue is also solved

Filed Under: Linux Tagged With: java

Reader Interactions

Comments

  1. Mehar says

    September 29, 2020 at 7:14 am

    How to print specific words (not letters) in matrix style? Is it possible with cmatrix?

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

fatal error: error writing to /tmp/ccwAjc9Z.s: No space left on device

Virtual Machine inaccessible status on VirtualBox 4.3

How to convert rpm file into deb file

curl command to check the http status

How to change hostname in Ubuntu 12.04 and 12.10 without system restart

Print double hyphen sign simultaneously in post of Octopress

Do not show line haveing particular keyword by grep command

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy