Official website download address
sudo mkdir java
sudo chmod 777 java
tar -zxvf JDK compressed file name-C /usr/java
Add in the /ect/profile file and enter
vim /etc/profile
Add to
# The directory here is the jdk installation directory
export JAVA_HOME=/usr/java/jdk1.8.0_211
# The following are the same
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export JRE_HOME=$JAVA_HOME/jre
After adding, run the following command to make the configuration effective
source /etc/profile
Use the command to check if there is version information, if there is information, it means the installation is complete
java -version
Recommended Posts