How to install jdk8/java8 with CentOS8
This article introduces you how to install jdk8/java8 on CentOS8, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Preface
At first, I wanted to download it with wget on CentOS8, then extract it and configure the environment variables, but I didn't do it well for a long time, so I gave up and installed it directly using yum.
1. Installation method
Yum is installed directly on CentOS8, and the environment variables are automatically configured.
2. Check to see if it is installed
The following results indicate that jdk has been installed and configured
[root@localhost] # java-versionopenjdk version "1.8.0,222" OpenJDK Runtime Environment (build 1.8.0_222-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
3. Uninstall
Check whether the system comes with jdk
Rpm-qa | grep javarpm-qa | grep jdkrpm-qa | grep gcj
If there is output information, the batch unloading system comes with
Rpm-qa | grep java | xargs rpm-e-nodeps
If you use the jdk installed by yum, uninstall it using the following command
Yum-y remove java-1.8.0-openjdk-headless.x86_64
4. Installation
4.1Check if there is a java1.8 package in yum
Yum list java-1.8*
4.2 start installation
Yum install java-1.8.0-openjdk*-y
5. Verification
[root@localhost] # java-versionopenjdk version "1.8.0,222" OpenJDK Runtime Environment (build 1.8.0_222-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
On how to install CentOS8 jdk8/java8 to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.