Foreword
At first, I wanted to use wget to download on CentOS8, then decompress it and configure environment variables, but after a long time I didn't do it well, so I gave up and installed it directly with yum.
1、 installation method
Use yum to install directly on CentOS8, and the environment variables are automatically configured
2、 Check if it is installed
See the following results, indicating that jdk has been installed and configured
[ root@localhost ~]# java -version
openjdk 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 java
rpm -qa |grep jdk
rpm -qa |grep gcj
If there is output information, the batch uninstall system comes with
rpm -qa | grep java | xargs rpm -e --nodeps
If you use the jdk installed by yum, please use the following command to uninstall
yum -y remove java-1.8.0-openjdk-headless.x86_64
4、 installation
4.1 Check 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 -version
openjdk 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)
to sum up
The above is the tutorial for installing jdk8 / java8 on CentOS8 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!
Recommended Posts