安装Java
下载jdk网址:http://www.oracle.com/technetwork/java/javase/downloads/index.html
下载文件:jdk-8u181-macosx-x64.dmg,双击安装
安装maven
下载maven压缩文件网址:http://maven.apache.org/download.cgi
解压到/Users/simon/Development/maven/apache-maven-3.5.4
配置国内maven仓库镜像
编辑maven的settings.xml文件
1
| vi /Users/simon/Development/maven/apache-maven-3.5.4/conf/settings.xml
|
找到mirrors
标签,并在标签里面添加如下内容
1 2 3 4 5 6 7 8 9 10 11 12
| <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror>
|
保存退出。以后项目就可以从国内阿里源下载jar包了,速度快得多了。
配置环境变量
编辑如下内容
1 2 3 4 5 6 7 8 9 10 11
| # Java export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home export JRE_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
# Maven export M2_HOME=/Users/simon/Development/apache-maven-3.5.4
export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH
|
让设置生效