- Download the corresponding jdk uploaded to the server
- To extract the installation directory
tar -zxvf jdk-8u231-linux-x64.tar.gz
- Rename & delete archive
rm jdk-8u231-linux-x64.tar.gz
mv jdk-8u231 jdk1.8
- Editing environment variable configuration file
vi /etc/profile
- Add at the end:
# java env setting
export JAVA_HOME=/opt/jdk1.8
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
- Validate the configuration
source /etc/profile
- Verification, the version number appears successful
java -version