1.去Maven官网下载zip的maven3.0.3压缩包
2.将安装包解压到某目录,我在这里解压到D:\Program Files (x86)\apache-maven-3.0.3
3.设置系统变量M2_HOME,值为D:\Program Files (x86)\apache-maven-3.0.3,注意路径中不要有任何引号,而且对于2.0.9版本之前的,路径最后不要有’\'字符4
4.设置系统变量M2,值为%M2_HOME%\bin
5.把%M2%添加到Path系统变量中
6.确保已经定义了JAVA_HOME系统变量,这里我设置的是C:\Program Files\Java\jdk1.7.0
7.打开命令控制台(运行-cmd),执行mvn –version命令:
结果:
C:\Users\Eric>mvn -version
Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800) Maven home: D:\Program Files (x86)\apache-maven-3.0.3 Java version: 1.7.0, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0\jre Default locale: zh_CN, platform encoding: GBK OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"安装成功