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

Example of how to configure cross-domain failure repair in nginx

Nginx cross-domain configuration does not take ef...

In-depth analysis of the diff algorithm in React

Understanding of diff algorithm in React diff alg...

Implementing custom radio and check box functions with pure CSS

1. Achieve the effect 2 Knowledge Points 2.1 <...

Tomcat8 uses cronolog to split Catalina.Out logs

background If the catalina.out log file generated...

5 Ways to Send Emails in Linux Command Line (Recommended)

When you need to create an email in a shell scrip...

A brief discussion of 3 new features worth noting in TypeScript 3.7

Table of contents Preface Optional Chaining Nulli...

Vue dynamic menu, dynamic route loading and refresh pitfalls

Table of contents need: Ideas: lesson: Share the ...

DOCTYPE element detailed explanation complete version

1. Overview This article systematically explains ...

25 div+css programming tips and tricks

1. The ul tag has a padding value by default in M...

Mysql tree-structured database table design

Table of contents Preface 1. Basic Data 2. Inheri...

CSS3 click button circular progress tick effect implementation code

Table of contents 8. CSS3 click button circular p...

border-radius is a method for adding rounded borders to elements

border-radius:10px; /* All corners are rounded wi...

Key issues and solutions for web page access speed

<br /> The website access speed can directly...