在服务器中安装jdk

# 安装亚马逊jdk 单次生效
wget https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.tar.gz
tar -zxvf amazon-corretto-8-x64-linux-jdk.tar.gz -C /usr/local/java/
vim /etc/profile
export JAVA_HOME=/usr/local/java/amazon-corretto-8.252.09.1-linux-x64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source /etc/profile
# oracle jdk
https://www.oracle.com/java/technologies/javase-jdk8-downloads.html#license-lightbox
tar -zxvf jdk-8u241-linux-x64.tar.gz -C /usr/local/java/
vim /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_241
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source /etc/profile
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页