mac系统配置maven全局变量

85 阅读1分钟

idea内安装的maven

  1. 找到idea安装路径,如/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib

  2. 更新~/.bash_profile和~/.zshrc

// vim ~/.bash_profile 新增如下(这里列举的是maven3版本)
export MAVEN_HOME="/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3"
export PATH="$PATH:$MAVEN_HOME/bin"

// ~/.zshrc
source ~/.bash_profile
  1. 更新
source ~/.bash_profile
source ~/.zshrc

外部安装

除了MAVEN_HOME路径不同,其他一致