1.去Maven官網下載zip的maven3.0.3壓縮包apache
2.將安裝包解壓到某目錄,我在這裏解壓到D:\Program Files (x86)\apache-maven-3.0.3windows
3.設置系統變量M2_HOME,值爲D:\Program Files (x86)\apache-maven-3.0.3,注意路徑中不要有任何引號,並且對於2.0.9版本以前的,路徑最後不要有’\'字符4maven
4.設置系統變量M2,值爲%M2_HOME%\binorm
5.把%M2%添加到Path系統變量中ip
6.確保已經定義了JAVA_HOME系統變量,這裏我設置的是C:\Program Files\Java\jdk1.7.0cmd
7.打開命令控制檯(運行-cmd),執行mvn –version命令:io
結果:form
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"變量
安裝成功jdk