5

Mac OS X下Maven的安装与配置

 3 years ago
source link: http://yuanfentiank789.github.io/2017/09/19/Mac-OS-X%E4%B8%8BMaven%E7%9A%84%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Mac OS X下Maven的安装与配置

Mac OS X 安装Maven:

  • 下载 Maven, 并解压到某个目录。例如/Users/robbie/apache-maven-3.3.3

  • 打开Terminal,输入以下命令,设置Maven classpath

     $ vi ~/.bash_profile

    添加下列两行代码,之后保存并退出Vi

     export M2_HOME=/Users/robbie/apache-maven-3.3.3
     export PATH=$PATH:$M2_HOME/bin
1240
bash_profile
  • 输入命令以使bash_profile生效

     $ source ~/.bash_profile
  • 输入mvn -v查看Maven是否安装成功

  • 如果遇到以下异常,重新编辑bash_profile文件,增加export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home后,并重新运行$ source ~/.bash_profile即可。

1240
exception
1240
new bash_profile
1240
maven version

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK