1.查找 maven 地址
访达--应用程序-- idea如图:

2.双击 选择 显示包内容:

3.找到maven地址:/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3
4.配置环境变量
(1)配置环境变量
终端输入
vim ~/.bash_profile
输入:
export MAVEN_HOME=/Applications/IntelliJ\ IDEA.app/Contents/plugins/maven/lib/maven3
export PATH=$PATH:$MAVEN_HOME/bin
保存 文件 .bash_profile
(2)启动新环境变量
终端输入:
source ~/.bash_profile
(3)验证
验证:mvn -v
报错:zsh: permission denied: mvn
(4)增加权限:
终端输入:
chmod a+x /Applications/IntelliJ\ IDEA.app/Contents/plugins/maven/lib/maven3/bin/mvn
(5)成功
本文详细介绍了如何在Mac上查找并配置IntelliJ IDEA内置的Maven地址,包括编辑.bash_profile设置环境变量,赋予mvn执行权限,并验证配置是否成功。在过程中遇到权限问题,通过chmod命令解决了这一问题。
5018

被折叠的 条评论
为什么被折叠?



