1.查看 yum 库中都有哪些 jdk 版本。
2.选择指定的版本安装,注意最后的 * 以及 yum 源安装的是 openjdk ,注意 openjdk 的区别。
3.安装完成后查看版本信息。
4.查找 jdk 的安装包。
1 2 3 4 5 6 7 8 9 | java-1.8.0-openjdk-headless-1.8.0.242.b08-1.el7.x86_64 java-1.8.0-openjdk-devel-1.8.0.242.b08-1.el7.x86_64 java-1.8.0-openjdk-javadoc-zip-1.8.0.242.b08-1.el7.noarch copy-jdk-configs-3.3-10.el7_5.noarch java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64 java-1.8.0-openjdk-accessibility-1.8.0.242.b08-1.el7.x86_64 java-1.8.0-openjdk-demo-1.8.0.242.b08-1.el7.x86_64 java-1.8.0-openjdk-javadoc-1.8.0.242.b08-1.el7.noarch java-1.8.0-openjdk-src-1.8.0.242.b08-1.el7.x86_64 |
5.查找安装包的安装路径。
1 2 3 4 5 6 7 8 9 10 | /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64/jre/bin/policytool /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64/jre/lib/amd64/libawt_xawt.so /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64/jre/lib/amd64/libjawt.so /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64/jre/lib/amd64/libjsoundalsa.so /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64/jre/lib/amd64/libsplashscreen.so /usr/share/applications/java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64-policytool.desktop /usr/share/icons/hicolor/16x16/apps/java-1.8.0-openjdk.png /usr/share/icons/hicolor/24x24/apps/java-1.8.0-openjdk.png /usr/share/icons/hicolor/32x32/apps/java-1.8.0-openjdk.png /usr/share/icons/hicolor/48x48/apps/java-1.8.0-openjdk.png |