Install JDK1.8 on Tencent Cloud Linux server

JDK installation under Linux

Create directories, download files

cd /usr/local
mkdir java
Downloading files is slow, so choose to download from csdn and upload to the java directory.
Download address, recommended: jdk download path

Unzip

tar -zxvf jdk-8u231-linux-x64.tar.gz

Configure!

  vim /etc/profile
#        /etc/profile   全局变量文件

shift+g quickly navigate to the bottom of the file, add the following content
JAVA_HOME is your own installation path

#java environment
export JAVA_HOME=/usr/local/java/jdk1.8.0_231  
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export  PATH=${JAVA_HOME}/bin:$PATH

Let environment variables take effect, verify

Effective
source /etc/profile
verification everyone knows pull!
java -version

Guess you like

Origin blog.csdn.net/NicolasLearner/article/details/112789905