mvn: command not found

  • Post author:
  • Post category:其他




Mac配置使用 IDEA默认的maven步骤

  1. 配置环境变量

MAVEN_HOME=/Applications/IntelliJ\ IDEA.app/Contents/plugins/maven/lib/maven3

export MAVEN_HOME

PATH=



P

A

T

H

:

PATH:






P


A


T


H




:





MAVEN_HOME/bin

export PATH

  1. 对 mvn 添加执行权限

chmod a+x /Applications/IntelliJ\ IDEA.app/Contents/plugins/maven/lib/maven3/bin/mvn

  1. 验证

fresherdeMacBook-Pro:target fresher$ mvn -v

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Maven home: /Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3

Java version: 1.8.0_144, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre

Default locale: zh_CN, platform encoding: UTF-8

OS name: “mac os x”, version: “10.16”, arch: “x86_64”, family: “mac”



版权声明:本文为FresherHe原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。