Install JDK on Ubuntu (for reference only) (Tsinghua mirror version 64-bit):

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
insert image description here
then download it like this
insert image description here
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 itinsert image description here

Guess you like

Origin blog.csdn.net/qq_29680161/article/details/104672509