Mac install maven

Install Maven on Mac OS X:

  • Download  Maven , and extract to a directory. For example /Users/robbie/apache-maven-3.3.3

  • Open Terminal, enter the following command, setMaven classpath

     $ vi ~/.bash_profile

    Add the following two lines of code, then save and exit Vi:

     export M2_HOME=/Users/robbie/apache-maven-3.3.3
     export PATH=$PATH:$M2_HOME/bin

bash_profile
  • Enter the command to bash_profiletake effect

     $ source ~/.bash_profile
  • Enter to mvn -vsee Mavenif the installation is successful

  • If you encounter the following exception, re-edit the bash_profilefile, add export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Homeit, and re-run it $ source ~/.bash_profile.


exception

 

Reference:  http://www.jianshu.com/p/191685a33786

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326274604&siteId=291194637