Linux安装JDK15
程序员文章站
2024-01-18 16:35:04
...
1.下载64位JKD 15.0.1.tar.gz
地址:https://www.oracle.com/java/technologies/javase-jdk15-downloads.html
2.上传jdk到Linux指定目录并解压
tar -zxvf jdk-15.0.1_linux-x64_bin.tar.gz
3.设置系统环境变量:修改/etc/environment,增加如下配置:
export JAVA_HOME=/usr/java/jdk-15.0.1
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
4.设置用户环境变量:修改/etc/profile,增加如下配置:
export JAVA_HOME=/usr/java/jdk-15.0.1
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
5.执行命令source profile,使修改文件生效;
6.执行java -version
地址:https://www.oracle.com/java/technologies/javase-jdk15-downloads.html
2.上传jdk到Linux指定目录并解压
tar -zxvf jdk-15.0.1_linux-x64_bin.tar.gz
3.设置系统环境变量:修改/etc/environment,增加如下配置:
export JAVA_HOME=/usr/java/jdk-15.0.1
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
4.设置用户环境变量:修改/etc/profile,增加如下配置:
export JAVA_HOME=/usr/java/jdk-15.0.1
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
5.执行命令source profile,使修改文件生效;
6.执行java -version