Linux learning: install jdk with yum on Linux server

yum install jdk

Using yum to install on Linux is very rude and mindless, but there are still points that need to be paid attention to, otherwise it will fall into the pit. Here are the steps.

1. Execute the command yum -y list java* to view the installable java version. After successful execution, you can see the following results

2. Choose a java version to install, here we want to install java1.8, because our machine is 64-bit, so choose to install java-1.8.0-openjdk-devel.x86_64.

There is a point to note here, the java version should be installed with -devel, because this one is jdk, and the one without -devel is actually jre.

3. Execute the command yum install -y java-1.8.0-openjdk-devel.x86_64. After execution, you will see a lot of output from the console.

Wait patiently until the automatic installation is complete

4. Enter java -version to view the installed jdk version. When the following output appears, the installation is successful.

5. You may be curious, where has the jdk installed by yum been installed? You can find them in the /usr/lib/jvm directory.

At this point, yum installation jdk is complete.

Guess you like

Origin blog.csdn.net/weixin_41812784/article/details/109165232
Recommended