二个月不弄,就忘了,记一下吧,脑子。。。
一、软件环境
1.centOS 7.x
2.JDK1.8
二、具体过程
1.切换到自己用户如xiaoming
2.进入用户根目录,编辑.bash_profile文件
> vim .bash_profile
修改内容:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/home/xiaoming/jdk/jdk1.8.0_171
CLASSPATH=.:$JAVA_HOME/bin/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH PATH
~
~
~
保存之后,source一下:
> source .bash_profile
测试
> echo $JAVA_HOME