CentOS8 installation tutorial of jdk8 / java8 (recommended)

CentOS8 installation tutorial of jdk8 / java8 (recommended)

Preface

At first, I wanted to use wget to download it on CentOS8, then decompress it and configure the environment variables. However, I failed to do it after a long time, so I gave up and installed it directly using yum.

1. Installation method

Use yum to install directly on CentOS8, and the environment variables are automatically configured

2. Check whether it has been installed

Seeing the following results, it means 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, batch uninstall system comes with

rpm -qa | grep java | xargs rpm -e --nodeps

If you installed JDK using yum, 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 java1.8 package in yum

yum list java-1.8*

4.2 Start the 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)

Summarize

The above is the tutorial on how to install jdk8 / java8 on CentOS8 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox
  • Linux system (Centos6.5 and above) installation jdk tutorial analysis
  • Graphical tutorial on installing JDK1.8 under CentOS7.4
  • Install JDK8 in rpm mode on CentOS7
  • Detailed tutorial on installing JDK8 on Linux system (CentOS7 installation)
  • Tutorial on deploying jdk and tomcat on centos7 without interface
  • Linux centOS installation JDK and Tomcat tutorial
  • Centos installation jdk case explanation

<<:  Summary of using MySQL online DDL gh-ost

>>:  React High-Order Component HOC Usage Summary

Recommend

Detailed tutorial on installing Docker and nvidia-docker on Ubuntu 16.04

Table of contents Docker Installation Nvidia-dock...

Detailed graphic tutorial on installing Ubuntu 20.04 dual system on Windows 10

win10 + Ubuntu 20.04 LTS dual system installation...

Test and solution for MySQL's large memory usage and high CPU usage

After the changes: innodb_buffer_pool_size=576M -...

How to solve the Docker container startup failure

Question: After the computer restarts, the mysql ...

Example of asynchronous file upload in html

Copy code The code is as follows: <form action...

JS implements layout conversion in animation

When writing animations with JS, layout conversio...

Basic usage knowledge points of mini programs (very comprehensive, recommended!)

Table of contents What to do when registering an ...

Vue+spring boot realizes the verification code function

This article example shares the specific code of ...

jquery+springboot realizes file upload function

This article example shares the specific code of ...

When MySQL is upgraded to 5.7, WordPress reports error 1067 when importing data

I recently upgraded MySQL to 5.7, and WordPress r...

Detailed explanation of the middleman mode of Angular components

Table of contents 1. Middleman Model 2. Examples ...

CSS3 speeds up and delays transitions

1. Use the speed control function to control the ...

How to handle long data when displaying it in html

When displaying long data in HTML, you can cut off...