How to install Maven on Windows
Apache Maven is not require to install on Windows as a service component, you just need to download the Maven’s zip file, extract it and configure the Windows environment path variable. See following steps :
1. Add JAVA_HOME
Make sure you had installed JDK, and add a new “JAVA_HOME” into Windows environment variable, and point to your JDK folder.

2. Download Apache Maven
Download Apache Maven zip file from this official website, e.g apache-maven-2.2.1-bin.zip.
3. Extract It
Extract the downloaded zip file, for instance, “D:\maven“.
That’s all , no installation is required on Windows.
4. Add MAVEN_HOME
Now, add Maven folder “MAVEN_HOME” to Windows environment variable also.

5. Add PATH
Add the “Maven bin folder” into Windows environment variable, so that you can access Maven command everywhere.

6. Verification
Done, to verify it, in command prompt, type “mvn –version” to verify the installation detail.
C:\Documents and Settings\mkyong>mvn -version Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800) Java version: 1.6.0_13 Java home: C:\Program Files\Java\jdk1.6.0_13\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
If you see similar message, means your Apache Maven is installed successful on Windows.
P.S The version may vary in your environment.
If it’s of any interest, I’ve published a Windows Installer MSI for Apache Maven 2.2.1 at http://www.kajabity.com/2012/01/windows-installer-for-apache-maven-2/
It installs the binaries, adds an uninstall link and Apache Maven link to the start menu and deals with the environment variables M2_HOME, M2, and adding M2 to Path.
Great Tutorial exact to point.
Very useful
Thanks for putting in,
In the image the maven home is “D:\maven” but in the text extract in “C:\apache-maven-2.2.1″ . It may confuse the user. Please change
Updated, sorry for the confuse
This is what it shows me…
C:\Documents and Settings\a500>java -version
java version “1.3.1_01″
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
C:\Documents and Settings\a500>mvn –version
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_26
Java home: C:\Program Files\Java\jdk1.6.0_26\jre
Default locale: en_US, platform encoding: Cp1252
OS name: “windows xp” version: “5.1″ arch: “x86″ Family: “windows”
I downloaded maven and already had jdk 1.6 installed on my system. But once I installed maven, it did show me the verification in the cmd prompt and the version, etc. But now when I tested my java version, it showed me 1.3 instead of 1.6.. Does anybody know why it is doing that? Any help is appreciated.
Thanks!
Check your Windows “Environment Variable”, classpath variable name in system variable, Windows will find your java command in this classpath.
Hi
I have already checked it.. It had jdk1.6 itself.. When I installed jdk(version 1.6) earlier, and checked it in cmd, it showed me 1.6 only.
Apache Maven uses the JDK pointed to by the JAVA_HOME variable.
I recently had to check this for myself and found that even though there were many versions installed and referenced in the classpath, and there was a version in the Windows directory (which was picked up when I used java –version), Maven always sticks with the JAVA_HOME version.
The following article is using Symbolic link to upgrade Maven version transparently using Windows 7 http://www.java-tutorial.ch/windows-systems/maven-installation-and-configuration-for-windows
Hi
Your tutorials are awesome.
Can you please start a new tutorials on EJB?
[...] Install Maven in Windows environment Article about how to install Maven in Windows environment. [...]
please
i did the steps and every thing is ok
but it does not show the lines :
Java home: C:\Program Files\Java\jdk1.6.0_13\jre
Default locale: en_US, platform encoding: Cp1252
please i need to know how to make it see java home.
Article updated for prerequisite requirement. It look like you have no JDK install or doesn’t configure the JAVA_HOME environment variable in Windows.
[...] How to install Maven in Windows or How to install Maven in Ubuntu [...]