CentOS7 installing the Java environment (JDK1.8)
1. Download JDK1.8
2. Create a folder
mkdir /usr/java
Copy the code
Upload jdK-8u221-linux-x64.tar. gz to this directory using FTP
3. Unzip
tar -xzvf jdk-8u221-linux-x64.tar.gz
Copy the code
4. Configure system environment variables
vim /etc/profile
Copy the code
Add at the end
JAVA_HOME = / usr/Java/jdk1.8.0 _221 JRE_HOME = / usr/Java/jdk1.8.0 _221 / jre PATH = $PATH: $JAVA_HOME/bin: $JRE_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib export JAVA_HOME JRE_HOME PATH CLASSPATHCopy the code
Configuration to take effect
source /etc/profile
Copy the code
5. Check the Java version
java -version
Copy the code
The following represents success
java version "1.8.0 comes with _221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
Copy the code
The public,
If you want to follow my updated articles and shared dry goods in real time, you can follow my official account.