码迷,mamicode.com
首页 > 系统相关 > 详细

linux 配置环境变量不生效

时间:2019-12-20 18:31:13      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:export   scala   ams   ram   The   配置   user   $path   cat   

解决普通用户 环境变量shell 退出不生效问题

1、在~/.bashrc 编辑了 scala
cat .bashrc

export SCALA_HOEM=/home/aipf/scala-2.11.12
export PATH=PATH:$SCALA_HOEM/bin

:wq

source ~/.bashrc


这样是永久生效的


但是有时候是退出shell,scala 命令不生效

cat .bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH=/usr/loacl/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/usr/bin:/root/bin

export PATH

注释 #export PATH=/usr/loacl/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/usr/bin:/root/bin

退出,重新登录OK

 

第二种方法

在执行脚本时,执行完后

source ~/.bashrc 后

在检查

linux 配置环境变量不生效

标签:export   scala   ams   ram   The   配置   user   $path   cat   

原文地址:https://www.cnblogs.com/pythonx/p/12074178.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!