AlmaLinux 9.1中安装java11
001、系统
[root@PC1 gatk-4.1.9.0]# cat /etc/redhat-release AlmaLinux release 9.1 (Lime Lynx)
002、测试java命令
[root@PC1 test]# java bash: java: command not found... Install package 'java-11-openjdk-headless' to provide command 'java'? [N/y] ^C ## 默认提示了安装 [root@PC1 test]# javac bash: javac: command not found... Install package 'java-11-openjdk-devel' to provide command 'javac'? [N/y] ^C ## 同上
003、直接根据提示安装
[root@PC1 test]# java bash: java: command not found... Install package 'java-11-openjdk-headless' to provide command 'java'? [N/y] y * Waiting in queue... * Loading list of packages.... The following packages have to be installed: java-11-openjdk-headless-1:11.0.17.0.8-2.el9_0.x86_64 OpenJDK 11 Headless Runtime Environment Proceed with changes? [N/y] y * Waiting in queue... * Waiting for authentication...
004、javac
[root@PC1 test]# yum list java-11* Last metadata expiration check: 0:24:45 ago on Thu 01 Dec 2022 05:41:24 PM CST. Installed Packages java-11-openjdk-headless.x86_64 1:11.0.17.0.8-2.el9_0 @appstream Available Packages java-11-openjdk.x86_64 1:11.0.17.0.8-2.el9_0 appstream java-11-openjdk-demo.x86_64 1:11.0.17.0.8-2.el9_0 appstream java-11-openjdk-devel.x86_64 1:11.0.17.0.8-2.el9_0 appstream java-11-openjdk-javadoc.x86_64 1:11.0.17.0.8-2.el9_0 appstream java-11-openjdk-javadoc-zip.x86_64 1:11.0.17.0.8-2.el9_0 appstream java-11-openjdk-jmods.x86_64 1:11.0.17.0.8-2.el9_0 appstream java-11-openjdk-src.x86_64 1:11.0.17.0.8-2.el9_0 appstream java-11-openjdk-static-libs.x86_64 1:11.0.17.0.8-2.el9_0 appstream [root@PC1 test]#
005、安装javac
yum install java-11-openjdk-devel.x86_64
006、测试java和javac命令
java --version
javac --version