Howtodojo logo
  • Home 
  • About 
  • Certifications 
  • Sample Database 
  • Cheatsheet 
  • Glossary 
  • Blog 
  • Tags 
  1.   Blog
  1. Home
  2. Blog
  3. How To Install OpenJDK 8 on Ubuntu 18.04

How To Install OpenJDK 8 on Ubuntu 18.04

Share via
Howtodojo
Link copied to clipboard

In this tutorial we learn how to install OpenJDK 8 on Ubuntu 18.04. We will learn installing both JDK and JRE, both headless and non-headless.

On this page
Introduction   Update Apt Package Index   Searching OpenJDK Packages on Ubuntu Repository   Install OpenJDK 8 on Ubuntu 18.04   Install OpenJDK 8 Java Development Kit (JDK)   Install OpenJDK 8 Java Runtime Environment (JRE)   Summary   References  
How To Install OpenJDK 8 on Ubuntu 18.04

Introduction  

In this tutorial we learn how to install OpenJDK 8 on Ubuntu 18.04 from Ubuntu repository.

Update Apt Package Index  

First of all update apt package index using the command below.

sudo apt-get update

alternatively, we can also use apt command below.

sudo apt update

Searching OpenJDK Packages on Ubuntu Repository  

To get list of available OpenJDK packages we can use command below.

sudo apt search ^openjdk-8

We will get output similar to below.

To search OpenJDK packages on Ubuntu we can also use apt-cache command below.

sudo apt-cache search ^openjdk

The output will be a little bit different that what we got from apt search command.

You can see sample output of this search below.

Install OpenJDK 8 on Ubuntu 18.04  

In this section we learn how to install OpenJDK 8 on Ubuntu 18.04. We will learn how to setup multiple alternatives of OpenJDK 8 on Ubuntu 18.04

Install OpenJDK 8 Java Development Kit (JDK)  

To install OpenJDK 8 JDK package we can use the command below.

sudo apt-get install openjdk-8-jdk

To install OpenJDK 8 JDK headless package we can use the command below.

sudo apt-get install openjdk-8-jdk-headless

Install OpenJDK 8 Java Runtime Environment (JRE)  

To install OpenJDK 8 JRE package we can use the command below.

sudo apt-get install openjdk-8-jre

To install OpenJDK 8 JRE Headless package we can use the command below.

sudo apt-get install openjdk-8-jre-headless

Summary  

In this tutorial we learn how to setup Java OpenJDK 8 on Ubuntu 18.04. Firstly, we install Java Development Kit (JDK) packages both headless and non-headless.Secondly, We install Java Runtime Environment (JRE) packages both headless and non-headless.

References  

In this section you can find several references to learn more about Java 8.

  • 1. Java Platform Standard Edition 8 Documentation
  • 2. Java SE Development Kit 8 Documentation Download
  • 3. Java Platform Standard Edition 8 API Specification
 How To Install OpenJDK 11 on Ubuntu 18.04
IUS Repository on CentOS 6 : How To Enable 
On this page:
Introduction   Update Apt Package Index   Searching OpenJDK Packages on Ubuntu Repository   Install OpenJDK 8 on Ubuntu 18.04   Install OpenJDK 8 Java Development Kit (JDK)   Install OpenJDK 8 Java Runtime Environment (JRE)   Summary   References  
Follow me

We publish tutorials, tips and tricks about Linux, open source, cloud computing, and infrastructure

     
Copyright © 2012 - 2025 howtodojo.com. |
Howtodojo
Code copied to clipboard