Description:
Below guideline are created under Centos 7
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
yum update
Install
yum install java-1.8.0-openjdk-devel
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
The original source is [Link].
Update apt
sudo apt update
install jdk
sudo apt install default-jdk
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