Centos7最简单的配置Java环境
root 进入后,
#ls -lart
看到 .bash_profile文件
vim .bash_profile 打开文件
输入如下:
-------------------------------------------------------
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
# Java Environment
export JAVA_HOME=/usr/local/jdk1.8.0_333
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:.
export PATH
----------------------------------------------------------------
结束后,执行如下刷新配置
#source .bash_profile
查看下时候生效
#java -version
[root@houxiurong ~]# java -version
java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)
[root@houxiurong ~]#
本文共计 921 字,感谢您的耐心浏览与评论。
0条回应:“Centos7最简单的配置Java环境”