Installation of CentOS (linux) JDK
The first blog has some shortcomings, please give us more advice. ^^
There are a lot of JDK articles downloaded from Linux on the Internet and I won’t copy them.
This article describes how novices can skillfully install JDK under linux.
CentOS 7.4 (Tencent Cloud)
Java SE Development Kit 8u172 (JDK version is best stable, especially for our novice, the latest version of various pits…)
JDK Official Website Download
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.tar.gz
Wget: is a commonly used download instruction for linux. Wget is followed by the specified URL address for download. Linux Command Complete
tar -zxvf jdk-8u172-linux-x64.tar.gz
Open WinSCP and you’ll see the JDK zip package and folder you just downloaded (both Xshell 6 and WinSCP login in the / root directory)
Create a new directory (I call it Environment) and move the unzipped JDK folder into the new directory and rename it JDK (the advantage is that you don’t need to change the configuration file to upgrade jdk, just overwrite it directly)
Open profile file under / etc
#set java environment JAVA_HOME=/root/Environment/jdk JRE_HOME=/root/Environment/jdk/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH
Open Xshell 6 input
source /etc/profileLet profile modifications take effect
java -versionDisplay the following content and configure successfully!
This concludes the small white tutorial on JDK installation under CentOS (linux).