mac添加bash_profile环境变量

简介: mac添加bash_profile环境变量

mac的环境变量

a. /etc/profile 
b. /etc/paths 
c. ~/.bash_profile 
d. ~/.bash_login 
e. ~/.profile 
f. ~/.bashrc 

其中

a和b是系统级别

c,d,e按照从前往后的顺序读取

如果c文件存在,则后面的几个文件就会被忽略不读了

~/.bashrc没有上述规则,bash shell打开的时候载入

建议在c中添加环境变量

修改

vim ~/.bash_profile

export MAVEN_HOME=/usr/local/apache-maven-3.6.0

export PATH=$PATH:$MAVEN_HOME

生效

source ~/.bash_profile

参考

mac下添加环境变量

            </div>
目录
相关文章
|
Android开发
mac下配置adb环境变量
在终端中输入adb命令时,会提示 command not found ,这是是因为mac电脑下没有配置Android环境变量或者环境变量配置错误。
|
3月前
|
Linux Shell
mac/linux提示bash: telnet: command not found
mac/linux提示bash: telnet: command not found
|
3月前
|
Linux Shell
mac/linux执行受限:bash: ./install.sh: Permission denied
mac/linux执行受限:bash: ./install.sh: Permission denied
|
5月前
|
Java Shell Linux
[醉了]解决重启mac但是bash_profile不生效的彻底解决方法
[醉了]解决重启mac但是bash_profile不生效的彻底解决方法
81 0
|
6月前
|
Shell iOS开发 MacOS
mac ~/.bash_profile 重启失效
mac ~/.bash_profile 重启失效
|
11月前
|
Shell
【Shell编程】Shell中Bash变量-环境变量
【Shell编程】Shell中Bash变量-环境变量
57 0
|
11月前
|
JavaScript Shell Linux
-bash: grunt: command not found去环境变量添加nodejs的路径
-bash: grunt: command not found去环境变量添加nodejs的路径
89 0
|
Shell
MAC修改.bashrc/.bash_profile无效,默认的用户配置文件是.zshrc,
MAC修改.bashrc/.bash_profile无效,默认的用户配置文件是.zshrc,
216 0
|
Shell
【技术分享】Mac终端bash和zsh切换
【技术分享】Mac终端bash和zsh切换
234 0