The installation process went smoothly
The advantage of downloading the Tsinghua mirror version is to directly decompress it and then configure the environment variables.
1. Download
URL: https://repo.huaweicloud.com/java/jdk/?C=M&O=A
Just download the latest one and
then download it like this
and put it in a file of the virtual machine to decompress. I am under the root directory Created a java folder
Configure the environment variables of all users and open the profile file
sudo gedit /etc/profile
Add the following at the end of the file:
#set Java environment
export JAVA_HOME=/java/jdk1.8.0_56
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
Restart the virtual machine and test it