最近在linux 安装maven是 设置环境变量
在linux环境下工作时,在当前窗口source /etc/profile配置是生效的。
然而再打开新的终端时,这个配置又不生效了。
解决办法:
1.编辑~/.bashrc文件
vim ~/.bashrc
2.在末尾添加如下代码
if [ -f /etc/profile ]; then
. /etc/profile
fi
3.wq!保存退出
测试 执行命令: mvn -version
最近在linux 安装maven是 设置环境变量
在linux环境下工作时,在当前窗口source /etc/profile配置是生效的。
然而再打开新的终端时,这个配置又不生效了。
解决办法:
1.编辑~/.bashrc文件
vim ~/.bashrc
2.在末尾添加如下代码
if [ -f /etc/profile ]; then
. /etc/profile
fi
3.wq!保存退出
测试 执行命令: mvn -version