CentOS 7 install Java 11 (OpenJDK)

以OpenJDK為例
1.搜索可安装的JDK
# sudo yum search java-11
確認搜索结果中是否有要的
例如
java-11-openjdk.x86_64 : OpenJDK Runtime Environment 11
java-11-openjdk-devel.x86_64 : OpenJDK Development Environment 11

2.假設要安裝OpenJDK Development Environment
#sudo yum install java-11-openjdk-devel.x86_64 -y

3.查看版本
# java -version



*.如果有多個版本可下指令選擇
# sudo alternatives --config java

留言