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]
-
Update yum
1yum update -
Install
1yum install java-1.8.0-openjdk-devel -
Verify installed java
1 2 3 4 5 6[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].
-
Update apt
1sudo apt update -
install jdk
1sudo apt install default-jdk -
verify installed jdk
1 2 3 4 5 6xethhung@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