centos7安装配置java环境变量
作者:高景洋 日期:2021-05-12 22:44:54 浏览次数:1825
一、官方下载地址 https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
注意:需要注册后,方可下载
下载版本:Linux x64 Compressed Archive
二、安装过程
1、创建安装目录 mkdir /usr/local/java/
2、解压至安装目录 tar -zxvf jdk-8u291-linux-x64.tar.gz -C /usr/local/java/
3、环境变量设置
a、打开文件 vim /etc/profile
b、添加环境变量
export JAVA_HOME=/usr/local/java/jdk1.8.0_291
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
c、使环境变量生效 source /etc/profile
d、添加软链接 ln -s /usr/local/java/jdk1.8.0_291/bin/java /usr/bin/java
e、java -version
本文永久性链接:
<a href="http://r4.com.cn/art185.aspx">centos7安装配置java环境变量</a>
<a href="http://r4.com.cn/art185.aspx">centos7安装配置java环境变量</a>
当前header:Host: r4.com.cn
X-Host1: r4.com.cn
X-Host2: r4.com.cn
X-Host3: 127.0.0.1:8080
X-Forwarded-For: 3.145.88.241
X-Real-Ip: 3.145.88.241
X-Domain: r4.com.cn
X-Request: GET /art185.aspx HTTP/1.1
X-Request-Uri: /art185.aspx
Connection: close
Accept: */*
User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Accept-Encoding: gzip, br, zstd, deflate