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

Detailed explanation of using echarts map in angular

Table of contents Initialization of echart app-ba...

Mysql NULL caused the pit

Using NULL in comparison operators mysql> sele...

MySQL data insertion efficiency comparison

When inserting data, I found that I had never con...

Detailed explanation of common template commands in docker-compose.yml files

Note: When writing the docker-compose.yml file, a...

JS achieves five-star praise effect

Use JS to implement object-oriented methods to ac...

Vue simulates the shopping cart settlement function

This article example shares the specific code of ...

Solutions to Files/Folders That Cannot Be Deleted in Linux

Preface Recently our server was attacked by hacke...

Detailed example of mysql similar to oracle rownum writing

Rownum is a unique way of writing in Oracle. In O...

In-depth explanation of environment variables and configuration files in CentOS

Preface The CentOS environment variable configura...

Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac

1. Download and unzip to: /Users/xiechunping/Soft...

How to authorize remote connections in MySQL in Linux

Note: Other machines (IP) cannot connect to the M...

Analysis of the use of the MySQL database show processlist command

In actual project development, if we have a lot o...

A Brief Analysis of Subqueries and Advanced Applications in MySql Database

Subquery in MySql database: Subquery: nesting ano...

SQL implements LeetCode (180. Continuous numbers)

[LeetCode] 180. Consecutive Numbers Write a SQL q...

How to quickly install Nginx in Linux

Table of contents What is nginx 1. Download the r...