Is production: true
#migrated

Title: How to install JDK8 on CentOs7 or ubuntu

Created: 19 Mar 2023 Modified: 19 Mar 2023

Description:



[Legacy Link]

Below guideline are created under Centos 7

Instructions for CentOs7

The original source is [Link], but this guide not completely correct.

The package java-1.8.0-openjdk doesn’t provide javac , need to change the package to java-1.8.0-openjdk-devel [Link]

  1. Update yum

    yum update
    
  2. Install

    yum install java-1.8.0-openjdk-devel
    
  3. Verify installed java

    [root@host jvm]# java -version
    openjdk version "1.8.0_222"
    OpenJDK Runtime Environment (build 1.8.0_222-b10)
    OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
    [root@host jvm]# javac -version
    javac 1.8.0_222
    

Instructions for Ubuntu

The original source is [Link].

  1. Update apt

    sudo apt update
    
  2. install jdk

    sudo apt install default-jdk 
    
  3. verify installed jdk

    xethhung@DESKTOP-0N1H14R:~$ java -version
    openjdk version "11.0.4" 2019-07-16
    OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
    OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)
    xethhung@DESKTOP-0N1H14R:~$ javac -version
    javac 11.0.4