This article is the first in the basic service series, and other services will be built in the future.
Download from the official websiteJDK8
8 u171
odd-numbered version, it is the version with bug fixes and all passed inspections, the official strongly recommends this version
8 u172
Even-numbered version, including all the content of odd-numbered version, and bug fixes that have not been verified
Install lrzsz for uploading files. yum install lrzsz
tar -xvf jdk-8u171-linux-x64.tar.gz
vi /etc/profile
# set java environment
JAVA_HOME=/usr/java/jdk1.8.0_171
JRE_HOME=/usr/java/jdk1.8.0_171/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
source /etc/profile
java -version
java
javac
There are other installation methods, you can refer to the next.
Three ways to install JDK under CentOS
Recommended Posts