- ALL
- linux31
- java27
- 工具13
- vue5
- nas5
- 其他5
- 前端5
- 数据库4
- git3
- framework3
- windows3
- ai2
- app2
- hexo2
- spring2
- api1
- 资源1
- docker1
- mysql1
- 安全1
- markdown1
- question1
- maven1
- nginx1
在CenterOS中安装java
下载JDK
Java SE 8的官方网址
jdk下载路径 点击下载
解压文件
tar -xvf jdk-8u65-linux-x64.tar.gz
添加环境变量
echo " ">>/etc/profile
echo "# Made for java env by chenqi on $(date +%F)">>/etc/profile
echo 'export JAVA_HOME=/usr/local/java'>>/etc/profile
echo 'export JRE_HOME=${JAVA_HOME}/jre'>>/etc/profile
echo 'export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib'>>/etc/profile
echo 'export PATH=${JAVA_HOME}/bin:$PATH'>>/etc/profile
tail -4 /etc/profile
source /etc/profile
echo $PATH
环境变量 ...