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

Mysql 5.7.19 free installation version encountered pitfalls (collection)

1. Download the 64-bit zip file from the official...

The benefits and examples of placing the site map at the bottom of the web page

In the past, almost every website had a sitemap p...

How to get the maximum or minimum value of a row in sql

Original data and target data Implement SQL state...

MySQL establishes efficient index example analysis

This article uses examples to describe how to cre...

CSS3 realizes the mask barrage function

Recently I saw a barrage effect on B station call...

How to enter directory/folder in Linux without using CD command

As we all know, without the cd command, we cannot...

Detailed explanation of MySQL persistent statistics

1. The significance of persistent statistical inf...

How to implement Linux automatic shutdown when the battery is low

Preface The electricity in my residence has been ...

Vue implements paging function

This article example shares the specific code of ...

JavaScript Dom implements the principle and example of carousel

If we want to make a carousel, we must first unde...

Detailed explanation of formatting numbers in MySQL

Recently, due to work needs, I need to format num...

How to install MySQL 8.0 in Docker

Environment: MacOS_Cetalina_10.15.1, Mysql8.0.18,...