在Mac下配置Maven环境

export M2_HOME=/Library/Java/apache-maven-3.5.0 
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home 
  • 在终端中运行 mvn –version 命令,检查Maven安装:

    终端显示:

Macintoshs-MacBook-Pro:~ macintosh$ mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /Library/Java/apache-maven-3.5.0
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /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.12.6", arch: "x86_64", family: "mac"

则证明Maven配置环境成功。

posted @ 2017-10-24 21:18  彭于晏码分晏  阅读(2548)  评论(0编辑  收藏  举报