After installing docker, then install jdk
[root@bogon ~]# java -version -bash: java: command not found
Found that jdk is not installed, now let's install it, the installation command
yum -y install jdk
Installation screenshot
[root@bogon ~]# yum -y install jdk Plugin loaded: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.aliyun.com There is no package jdk available. Error: No action required [root@bogon ~]# yum -y install java Plugin loaded: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.aliyun.com Resolving dependencies --> Checking transaction ---> Package java-1.8.0-openjdk.x86_64.1.1.8.0.161-0.b14.el7_4 will be installed --> Processing dependency java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.161-0.b14.el7_4, which is used by package 1:java-1.8.0-openjdk-1.8. 0.161-0.b14.el7_4.x86_64 Required --> Processing dependency xorg-x11-fonts-Type1, which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libpng15.so.15(PNG15_0)(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjvm.so(SUNWprivate_1.1)(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjpeg.so.62(LIBJPEG_6.2)(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjli.so(SUNWprivate_1.1)(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjava.so(SUNWprivate_1.1)(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency fontconfig(x86-64), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libpng15.so.15()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjvm.so()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjpeg.so.62()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjli.so()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libjava.so()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libgif.so.4()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libawt.so()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libXtst.so.6()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libXrender.so.1()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libXi.so.6()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libXext.so.6()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libXcomposite.so.1()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency libX11.so.6()(64bit), which is required by package 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 --> Checking transaction ---> Package fontconfig.x86_64.0.2.10.95-11.el7 will be installed --> Processing dependency fontpackages-filesystem, which is required by package fontconfig-2.10.95-11.el7.x86_64 --> Processing dependency font(:lang=en), which is required by package fontconfig-2.10.95-11.el7.x86_64 ---> Package giflib.x86_64.0.4.1.6-9.el7 will be installed --> Processing dependency libSM.so.6()(64bit), which is required by package giflib-4.1.6-9.el7.x86_64 --> Processing dependency libICE.so.6()(64bit), which is required by package giflib-4.1.6-9.el7.x86_64 ---> Package java-1.8.0-openjdk-headless.x86_64.1.1.8.0.161-0.b14.el7_4 will be installed --> Processing dependency tzdata-java >= 2015d, which is required by package 1:java-1.8.0-openjdk-headless-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependencies copy-jdk-configs >= 2.2, which is required by package 1:java-1.8.0-openjdk-headless-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency lksctp-tools (x86-64), which is required by package 1:java-1.8.0-openjdk-headless-1.8.0.161-0.b14.el7_4.x86_64 --> Processing dependency jpackage-utils, which is required by package 1:java-1.8.0-openjdk-headless-1.8.0.161-0.b14.el7_4.x86_64 ---> Package libX11.x86_64.0.1.6.5-1.el7 will be installed --> Processing dependency libX11-common >= 1.6.5-1.el7, which is required by package libX11-1.6.5-1.el7.x86_64 --> Processing dependency libxcb.so.1()(64bit), which is required by package libX11-1.6.5-1.el7.x86_64 ---> Package libXcomposite.x86_64.0.0.4.4-4.1.el7 will be installed ---> Package libXext.x86_64.0.1.3.3-3.el7 will be installed ---> Package libXi.x86_64.0.1.7.9-1.el7 will be installed ---> Package libXrender.x86_64.0.0.9.10-1.el7 will be installed ---> Package libXtst.x86_64.0.1.2.3-1.el7 will be installed ---> Package libjpeg-turbo.x86_64.0.1.2.90-5.el7 will be installed ---> Package libpng.x86_64.2.1.5.13-7.el7_2 will be installed ---> Package xorg-x11-fonts-Type1.noarch.0.7.5-9.el7 will be installed --> Processing dependency ttmkfdir, which is required by package xorg-x11-fonts-Type1-7.5-9.el7.noarch --> Processing dependency ttmkfdir, which is required by package xorg-x11-fonts-Type1-7.5-9.el7.noarch --> Processing dependency mkfontdir, which is required by package xorg-x11-fonts-Type1-7.5-9.el7.noarch --> Processing dependency mkfontdir, which is required by package xorg-x11-fonts-Type1-7.5-9.el7.noarch --> Checking transaction ---> Package copy-jdk-configs.noarch.0.2.2-5.el7_4 will be installed ---> Package fontpackages-filesystem.noarch.0.1.44-8.el7 will be installed ---> Package javapackages-tools.noarch.0.3.4.1-11.el7 will be installed --> Processing dependency python-javapackages=3.4.1-11.el7, which is required by package javapackages-tools-3.4.1-11.el7.noarch ---> Package libICE.x86_64.0.1.0.9-9.el7 will be installed ---> Package libSM.x86_64.0.1.2.2-2.el7 will be installed ---> Package libX11-common.noarch.0.1.6.5-1.el7 will be installed ---> Package libxcb.x86_64.0.1.12-1.el7 will be installed --> Processing dependency libXau.so.6()(64bit), which is required by package libxcb-1.12-1.el7.x86_64 ---> Package lksctp-tools.x86_64.0.1.0.17-2.el7 will be installed ---> Package stix-fonts.noarch.0.1.1.0-5.el7 will be installed ---> Package ttmkfdir.x86_64.0.3.0.9-42.el7 will be installed ---> Package tzdata-java.noarch.0.2018c-1.el7 will be installed ---> Package xorg-x11-font-utils.x86_64.1.7.5-20.el7 will be installed --> Processing dependency libfontenc.so.1()(64bit), which is required by package 1:xorg-x11-font-utils-7.5-20.el7.x86_64 --> Processing dependency libXfont.so.1()(64bit), which is required by package 1:xorg-x11-font-utils-7.5-20.el7.x86_64 --> Checking transaction ---> Package libXau.x86_64.0.1.0.8-2.1.el7 will be installed ---> Package libXfont.x86_64.0.1.5.2-1.el7 will be installed ---> Package libfontenc.x86_64.0.1.1.3-3.el7 will be installed ---> Package python-javapackages.noarch.0.3.4.1-11.el7 will be installed --> Processing dependency python-lxml, which is required by package python-javapackages-3.4.1-11.el7.noarch --> Checking transaction ---> Package python-lxml.x86_64.0.3.2.1-4.el7 will be installed --> Resolve dependencies complete Dependency Resolution ============================================================================================================================================================= Package schema version source size ============================================================================================================================================================= Installing: java-1.8.0-openjdk x86_64 1:1.8.0.161-0.b14.el7_4 updates 243 k Install for dependencies: copy-jdk-configs noarch 2.2-5.el7_4 updates 19 k fontconfig x86_64 2.10.95-11.el7 base 229 k fontpackages-filesystem noarch 1.44-8.el7 base 9.9 k giflib x86_64 4.1.6-9.el7 base 40 k java-1.8.0-openjdk-headless x86_64 1:1.8.0.161-0.b14.el7_4 updates 32 M javapackages-tools noarch 3.4.1-11.el7 base 73 k libICE x86_64 1.0.9-9.el7 base 66 k libSM x86_64 1.2.2-2.el7 base 39 k libX11 x86_64 1.6.5-1.el7 base 606 k libX11-common noarch 1.6.5-1.el7 base 164 k libXau x86_64 1.0.8-2.1.el7 base 29 k libXcomposite x86_64 0.4.4-4.1.el7 base 22 k libXext x86_64 1.3.3-3.el7 base 39 k libXfont x86_64 1.5.2-1.el7 base 152 k libXi x86_64 1.7.9-1.el7 base 40 k libXrender x86_64 0.9.10-1.el7 base 26 k libXtst x86_64 1.2.3-1.el7 base 20 k libfontenc x86_64 1.1.3-3.el7 base 31 k libjpeg-turbo x86_64 1.2.90-5.el7 base 134 k libpng x86_64 2:1.5.13-7.el7_2 base 213 k libxcb x86_64 1.12-1.el7 base 211 k lksctp-tools x86_64 1.0.17-2.el7 base 88 k python-javapackages noarch 3.4.1-11.el7 base 31 k python-lxml x86_64 3.2.1-4.el7 base 758 k stix-fonts noarch 1.1.0-5.el7 base 1.3 M ttmkfdir x86_64 3.0.9-42.el7 base 48 k tzdata-java noarch 2018c-1.el7 updates 184 k xorg-x11-font-utils x86_64 1:7.5-20.el7 base 87 k xorg-x11-fonts-Type1 noarch 7.5-9.el7 base 521 k Transaction Summary ============================================================================================================================================================= Install 1 package (+29 dependent packages) Total downloads: 37 M Installation size: 116M Downloading packages: (1/30): fontpackages-filesystem-1.44-8.el7.noarch.rpm | 9.9 kB 00:00:00 (2/30): copy-jdk-configs-2.2-5.el7_4.noarch.rpm | 19 kB 00:00:00 (3/30): javapackages-tools-3.4.1-11.el7.noarch.rpm | 73 kB 00:00:00 (4/30): giflib-4.1.6-9.el7.x86_64.rpm | 40 kB 00:00:00 (5/30): libICE-1.0.9-9.el7.x86_64.rpm | 66 kB 00:00:00 (6/30): fontconfig-2.10.95-11.el7.x86_64.rpm | 229 kB 00:00:00 (7/30): java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64.rpm | 243 kB 00:00:00 (8/30): libSM-1.2.2-2.el7.x86_64.rpm | 39 kB 00:00:00 (9/30): libXcomposite-0.4.4-4.1.el7.x86_64.rpm | 22 kB 00:00:00 (10/30): libX11-common-1.6.5-1.el7.noarch.rpm | 164 kB 00:00:00 (11/30): libXau-1.0.8-2.1.el7.x86_64.rpm | 29 kB 00:00:00 (12/30): libXfont-1.5.2-1.el7.x86_64.rpm | 152 kB 00:00:00 (13/30): libX11-1.6.5-1.el7.x86_64.rpm | 606 kB 00:00:01 (14/30): libXext-1.3.3-3.el7.x86_64.rpm | 39 kB 00:00:00 (15/30): libXrender-0.9.10-1.el7.x86_64.rpm | 26 kB 00:00:00 (16/30): libfontenc-1.1.3-3.el7.x86_64.rpm | 31 kB 00:00:00 (17/30): libXtst-1.2.3-1.el7.x86_64.rpm | 20 kB 00:00:00 (18/30): libXi-1.7.9-1.el7.x86_64.rpm | 40 kB 00:00:00 (19/30): libxcb-1.12-1.el7.x86_64.rpm | 211 kB 00:00:00 (20/30): lksctp-tools-1.0.17-2.el7.x86_64.rpm | 88 kB 00:00:00 (21/30): libpng-1.5.13-7.el7_2.x86_64.rpm | 213 kB 00:00:00 (22/30): python-javapackages-3.4.1-11.el7.noarch.rpm | 31 kB 00:00:00 (23/30): ttmkfdir-3.0.9-42.el7.x86_64.rpm | 48 kB 00:00:00 (24/30): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm | 134 kB 00:00:00 (25/30): xorg-x11-font-utils-7.5-20.el7.x86_64.rpm | 87 kB 00:00:00 (26/30): tzdata-java-2018c-1.el7.noarch.rpm | 184 kB 00:00:00 (27/30): xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm | 521 kB 00:00:00 (28/30): stix-fonts-1.1.0-5.el7.noarch.rpm | 1.3 MB 00:00:00 (29/30): python-lxml-3.2.1-4.el7.x86_64.rpm | 758 kB 00:00:00 (30/30): java-1.8.0-openjdk-headless-1.8.0.161-0.b14.el7_4.x86_64.rpm | 32 MB 00:00:15 ------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 2.3 MB/s | 37 MB 00:00:15 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing: libfontenc-1.1.3-3.el7.x86_64 1/30 Installing: fontpackages-filesystem-1.44-8.el7.noarch 2/30 Installing: libjpeg-turbo-1.2.90-5.el7.x86_64 3/30 Installing: libICE-1.0.9-9.el7.x86_64 4/30 Installing: libSM-1.2.2-2.el7.x86_64 5/30 Installing: stix-fonts-1.1.0-5.el7.noarch 6/30 Installing: fontconfig-2.10.95-11.el7.x86_64 7/30 Installing: libXfont-1.5.2-1.el7.x86_64 8/30 Installing: 1:xorg-x11-font-utils-7.5-20.el7.x86_64 9/30 Installing: libXau-1.0.8-2.1.el7.x86_64 10/30 Installing: libxcb-1.12-1.el7.x86_64 11/30 Installing: libX11-common-1.6.5-1.el7.noarch 12/30 Installing: libX11-1.6.5-1.el7.x86_64 13/30 Installing: libXext-1.3.3-3.el7.x86_64 14/30 Installing: libXi-1.7.9-1.el7.x86_64 15/30 Installing: libXtst-1.2.3-1.el7.x86_64 16/30 Installing: libXrender-0.9.10-1.el7.x86_64 17/30 Installing: giflib-4.1.6-9.el7.x86_64 18/30 Installing: libXcomposite-0.4.4-4.1.el7.x86_64 19/30 Installing: lksctp-tools-1.0.17-2.el7.x86_64 20/30 Installing: ttmkfdir-3.0.9-42.el7.x86_64 21/30 Installing: xorg-x11-fonts-Type1-7.5-9.el7.noarch 22/30 Installing: 2:libpng-1.5.13-7.el7_2.x86_64 23/30 Installing: python-lxml-3.2.1-4.el7.x86_64 24/30 Installing: python-javapackages-3.4.1-11.el7.noarch 25/30 Installing: javapackages-tools-3.4.1-11.el7.noarch 26/30 Installing: copy-jdk-configs-2.2-5.el7_4.noarch 27/30 Installing: tzdata-java-2018c-1.el7.noarch 28/30 Installing: 1:java-1.8.0-openjdk-headless-1.8.0.161-0.b14.el7_4.x86_64 29/30 Installing: 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 30/30 Verifying: libXext-1.3.3-3.el7.x86_64 1/30 Verifying: libX11-1.6.5-1.el7.x86_64 2/30 Verifying: libXi-1.7.9-1.el7.x86_64 3/30 Verifying: 1:java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 4/30 Verifying: libICE-1.0.9-9.el7.x86_64 5/30 Verifying: tzdata-java-2018c-1.el7.noarch 6/30 Verifying: libjpeg-turbo-1.2.90-5.el7.x86_64 7/30 Verifying: libXrender-0.9.10-1.el7.x86_64 8/30 Verifying: copy-jdk-configs-2.2-5.el7_4.noarch 9/30 Verifying: libXfont-1.5.2-1.el7.x86_64 10/30 Verifying: python-lxml-3.2.1-4.el7.x86_64 11/30 Verifying: 2:libpng-1.5.13-7.el7_2.x86_64 12/30 Verifying: fontpackages-filesystem-1.44-8.el7.noarch 13/30 Verifying: ttmkfdir-3.0.9-42.el7.x86_64 14/30 Verifying: giflib-4.1.6-9.el7.x86_64 15/30 Verifying: stix-fonts-1.1.0-5.el7.noarch 16/30 Verifying: libXcomposite-0.4.4-4.1.el7.x86_64 17/30 Verifying: libXtst-1.2.3-1.el7.x86_64 18/30 Verifying: lksctp-tools-1.0.17-2.el7.x86_64 19/30 Verifying: libxcb-1.12-1.el7.x86_64 20/30 Verifying: xorg-x11-fonts-Type1-7.5-9.el7.noarch 21/30 Verifying: python-javapackages-3.4.1-11.el7.noarch 22/30 Verifying: javapackages-tools-3.4.1-11.el7.noarch 23/30 Verifying: libX11-common-1.6.5-1.el7.noarch 24/30 Verifying: libXau-1.0.8-2.1.el7.x86_64 25/30 Verifying: libSM-1.2.2-2.el7.x86_64 26/30 Verifying: fontconfig-2.10.95-11.el7.x86_64 27/30 Verifying: 1:java-1.8.0-openjdk-headless-1.8.0.161-0.b14.el7_4.x86_64 28/30 Verifying: libfontenc-1.1.3-3.el7.x86_64 29/30 Verifying: 1:xorg-x11-font-utils-7.5-20.el7.x86_64 30/30 It has been installed: java-1.8.0-openjdk.x86_64 1:1.8.0.161-0.b14.el7_4 Installed as a dependency: copy-jdk-configs.noarch 0:2.2-5.el7_4 fontconfig.x86_64 0:2.10.95-11.el7 fontpackages-filesystem.noarch 0:1.44-8.el7 giflib.x86_64 0:4.1.6-9.el7 java-1.8.0-openjdk-headless.x86_64 1:1.8.0.161-0.b14.el7_4 javapackages-tools.noarch 0:3.4.1-11.el7 libICE.x86_64 0:1.0.9-9.el7 libSM.x86_64 0:1.2.2-2.el7 libX11.x86_64 0:1.6.5-1.el7 libX11-common.noarch 0:1.6.5-1.el7 libXau.x86_64 0:1.0.8-2.1.el7 libXcomposite.x86_64 0:0.4.4-4.1.el7 libXext.x86_64 0:1.3.3-3.el7 libXfont.x86_64 0:1.5.2-1.el7 libXi.x86_64 0:1.7.9-1.el7 libXrender.x86_64 0:0.9.10-1.el7 libXtst.x86_64 0:1.2.3-1.el7 libfontenc.x86_64 0:1.1.3-3.el7 libjpeg-turbo.x86_64 0:1.2.90-5.el7 libpng.x86_64 2:1.5.13-7.el7_2 libxcb.x86_64 0:1.12-1.el7 lksctp-tools.x86_64 0:1.0.17-2.el7 python-javapackages.noarch 0:3.4.1-11.el7 python-lxml.x86_64 0:3.2.1-4.el7 stix-fonts.noarch 0:1.1.0-5.el7 ttmkfdir.x86_64 0:3.0.9-42.el7 tzdata-java.noarch 0:2018c-1.el7 xorg-x11-font-utils.x86_64 1:7.5-20.el7 xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 complete!
After installation, check the jdk version
[root@bogon ~]# java -version openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)