Graphical tutorial on installing JDK1.8 under CentOS7.4

Graphical tutorial on installing JDK1.8 under CentOS7.4

Linux installation JDK1.8 steps

1. Check whether CentOS has its own openJDK. It is not recommended to use the built-in one, so uninstall it first.

Enter the command "java -version", the following figure shows the built-in openJDK

2. Uninstall the built-in openJDK method:

First query the files with java: enter the command "rpm -qa|grep java" and delete the java files other than .norach

Execute the deletion command: "rpm -e --nodeps java-1.8.0-openjdk-headless"

Execute the deletion command: "rpm -e --nodeps java-1.8.0-openjdk" (You can use the tab key to automatically fill in)

After the uninstallation is complete, start downloading and installing jdk.

3. Download JDK

Select the corresponding jdk according to the bit number of the system, and check the bit number command "getconf LONG_BIT"

Download address:

64-bit: Link: https://pan.baidu.com/s/1tccc9tlwhCScmZp90urRGw Extraction code: wmvi

32-bit: https://pan.baidu.com/s/1n3jtj0yaa091HZ0ZBYyJGA Extraction code: x25w

4. Upload JDK

Use the rz command to upload. If there is no rz command, install it first using yum -y install lrzsz

5. Unzip JDK

Execute the command "tar -zxvf jdk-8u161-linux-x64.tar.gz"

6. Configure environment variables

The environment variables of the Windows operating system are configured through tools. On Linux, the environment variables are stored in the profile file. Open the file and use vim to modify it.

(You can also download and modify it in sz and then upload it in rz. I think it is more convenient to edit. Personal operation, not professional, please don't criticize!)

The configuration is as follows:

#The path of the decompressed jdk
export JAVA_HOME=/home/luminita/tools/java/jdk1.8.0_161
export JRE_HOME=${JAVA_HOME}/jre
export CLASS_PATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}

After the configuration is complete, execute the command "source /etc/profile" to make the file effective.

7. Verify whether the installation is successful

Execute the command "java -version", the installation is successful as follows, which is consistent with Windows

Summarize

This is the end of this graphic tutorial on how to install JDK 1.8 on CentOS 7.4. For more information about installing JDK 1.8 on CentOS 7.4, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Centos 7 installation of OpenJDK 11 two ways and problem summary
  • Centos installation jdk case explanation
  • Install JDK8 in rpm mode on CentOS7
  • Introduction to installing and configuring JDK under CentOS system

<<:  npm Taobao mirror modification explanation

>>:  ERROR 1862 (HY000): Your password has expired. To log in you must change it using a .....

Recommend

Implementation steps for setting up the React+Ant Design development environment

Basics 1. Use scaffolding to create a project and...

Example of how to set up a third-level domain name in nginx

Problem Description By configuring nginx, you can...

Summary of several common ways to abbreviate javascript code

Table of contents Preface Arrow Functions Master ...

Steps to install GRUB on Linux server

How to Install GRUB for Linux Server You cannot u...

How to solve the problem of character set when logging in to Linux

Character set error always exists locale: Cannot ...

Detailed explanation of Vue options

Table of contents 1. What are options? 2. What at...

CentOS 6 uses Docker to deploy Zookeeper operation example

This article describes how to use docker to deplo...

Two ways to achieve horizontal arrangement of ul and li using CSS

Because li is a block-level element and occupies ...

MYSQL A question about using character functions to filter data

Problem description: structure: test has two fiel...

Best Practices for Implementing Simple Jira Projects with React+TS

A set of projects for training react+ts Although ...

Introduction to TypeScript basic types

Table of contents 1. Basic types 2. Object Type 2...

Two ways to make IE6 display PNG-24 format images normally

Method 1: Please add the following code after <...

Navicat Premium operates MySQL database (executes sql statements)

1. Introduction to Navicat 1. What is Navicat? Na...