按月存档: 2020/03

CentOS7配置JDK环境变量

分类:linux日期:2020-03-05 - 10:26:39评论:0条作者:老谢

  http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html下载Linux x64 Compressed Archive版本最新的安装包。

tar -zxf jdk-8u241-linux-x64.tar.gz
mkdir /usr/local/java/
mv jdk1.8.0_241/ /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
ln -s /usr/local/java/jdk1.8.0_241/bin/java /usr/bin/java
java -version
Tags: , ,