Mac OS X下Maven的安装与配置
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.
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
-
输入命令以使
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
即可。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK