美文网首页
centos 搭建java简单环境

centos 搭建java简单环境

作者: 小黄龙V5 | 来源:发表于2021-12-10 13:50 被阅读0次

1.安装jdk

https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html#license-lightbox

rpm -ivh jdk-8u251-linux-x64.rpm

2.设置环境变量
vi ~/.bashrc

export JAVA_HOME=/usr/java/jdk1.8.0_251-amd64
export JRE_HOME=JAVA_HOME/jre export CLASSPATH=JAVA_HOME/lib:JRE_HOME/lib:CLASSPATH
export PATH=JAVA_HOME/bin:JRE_HOME/bin:$PATH

source ~/.bashrc

3.验证:

java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)

4.修改权限
chown -R userDev:userDev /mnt/
chmod 755 /mnt/

相关文章

网友评论

      本文标题:centos 搭建java简单环境

      本文链接:https://www.haomeiwen.com/subject/cvlgsltx.html