sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http:%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b3812448
1863 b1413dce1855f/jdk-10.0.2_linux-x64_bin.tar.gz"
Note that the version may be updated at any time, if it becomes invalid, please go to Official Website to copy the link and replace
sudo tar -zxvf jdk-10.0.2_linux-x64_bin.tar.gz
sudo mv jdk-10.0.2/usr/lib/
sudo vim /etc/profile
Add the following content:
export JAVA_HOME=/usr/lib/jdk-10.0.2export CLASSPATH=.:${JAVA_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH
Make environment variables take effect
source /etc/profile
View version
java -version
Recommended Posts