How to install OpenJDK 8 in Ubuntu 18.04?

JDK 16 Features Why You Should Learn Java in 2021? Java/JDK 15 upcoming new features JDK/Java 15 Tutorials How to install OpenJDK 8 in Ubuntu 18.04? Java Interpreter is used for which purpose? Java program to read a text file and write to another file How to Serialize and Deserialize Array List in Java? What are the prerequisites for learning Java? How to replace all occurrences of a string in JavaScript? How to convert a stack trace to a string? Example code of reading file line by line in Java with Apache Commons IO library How to store unique values in Java using Set? java.nio ShortBuffer Example How to use Java Path class? Java NIO Package Tutorial How to limit object creation in Java? Java 11 String lines function example to split it in lines Top upcoming features of JDK 11 Java/JDK 11 Tutorial How to install JDK 10 in Ubuntu 18.04? Install JDK 10 on Windows Java 10 features Processing large file in Java Learning Java for non programmers Why You Should Learn Java in 2018? Installing JDK 9 on Windows 10 How to convert binary to decimal in Java? How to add two numbers in Java? What is Applet in Java with Example? What is nested class in Java with Example? Exception handling in Java Programming Examples What is Constructor Overloading in Java? How to display image in Swing? What is Java programming used for? How to create custom exception in Java? How to set CLASSPATH in Java? What is Multithreading in Java? IO Streams in Java with Examples How to convert String Date to Timestamp in Java?

How to install OpenJDK 8 in Ubuntu 18.04?

In this tutorial we will teach you to install the OpenJDK 8 in Ubuntu 18.04.

In this tutorial we will teach you to install the OpenJDK 8 in Ubuntu 18.04.

How to install OpenJDK 8 in Ubuntu 16.04/18.04?

In this tutorial we are going to guide you steps by step for installing the OpenJDK 8 on Ubuntu 18.04 operating system. The steps given here will apply to other versions of Ubuntu operating system including Ubuntu 16.04, Ubuntu 18.04 and Ubuntu 19.04. So, if you any version of Ubuntu operating system you can follow these steps to install OpenJDK 8 on your system.

You should have direct internet access on your computer because the apt installer will connect to online repository to download the required packages and then install on your Ubuntu Operating system.

OpenJDK is very popular and there is no restriction on the use of this distribution of JDK. You can use the apt-get installer on Ubuntu operating system to install OpenJDK easily.

Steps to install OpenJDK 8 in Ubuntu 18.04

Let's follow the step by step process to install OpenJDK on Ubuntu 18.04 operating system.

Step 1: Update your system

Run the following command to update your system.

sudo apt-get update

Above command will update your system with the information about the latest updates available for Ubuntu 18.04 operating system. Here is the output of the command:

[email protected]:~$ sudo apt-get update
[sudo] password for deepak: 
Hit:1 bionic InRelease
Get:2 bionic-updates InRelease [88.7 kB]
Get:3 bionic-backports InRelease [74.6 kB] 
Get:4 bionic-security InRelease [88.7 kB]    
Get:5 bionic-updates/main amd64 DEP-11 Metadata [301 kB]
Get:6 bionic-updates/universe amd64 DEP-11 Metadata [273 kB]
Get:7 bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:8 bionic-backports/universe amd64 DEP-11 Metadata [7,968 B]
Get:9 bionic-security/main amd64 DEP-11 Metadata [38.7 kB]
Get:10 bionic-security/universe amd64 DEP-11 Metadata [42.0 kB]
Get:11 bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Fetched 920 kB in 2s (486 kB/s)                                             
Reading package lists... Done

Now we will go to the next step for installing the OpenJDK 8.

Step 2: Run the command to install OpenJDK 8

To install the OpenJDK 8 on your system you can run the following apt-get install command:

sudo apt install openjdk-8-jdk

Here is the screen shot of the process:

How to install OpenJDK 8 in Ubuntu 18.04?

Above step installs OpenJDK 8 on your Ubuntu 18.04 operating system. Now you can check the version of JDK installed.

Step 3: Check JDK version on your computer

java -version

It should display the version of JDK installed on your Ubuntu operating system. Here is output on my system:

[email protected]:~$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
[email protected]:~$ 

Finally OpenJDK 8 is installed our Ubuntu 18.04 operating system. In this tutorial you learned to install OpenJDK 8 on Ubuntu 18.04 operating system.

Check more tutorials at: