-
Notifications
You must be signed in to change notification settings - Fork 0
Maven Installation: Windows
So first off you'll need to download maven of course! Head over to Apache Maven and pick a version to download.
Once you've done that, unzip the archive you just downloaded to a directory of your choice, In this case I've extracted mine to
C:/Program Files/Apache-Maven/3.2.1
Once you've got it extracted to your directory of choice it's time to setup your environment variables so you can use maven from the command prompt
Note: I'll be assuming you're using JDK1.7.0 and have your java installed at
C:/Program Files/Java/
and downloaded Maven version 3.2.1.
Alright, lets get started! Enter these commands to setup your environment variable settings:
set MAVEN_HOME=C:\Progra~1\Apache-Maven\3.2.1 # Progra~1 is just a shortcut for /Program Files/
set JAVA_HOME=C:\Progra~1\Java\jdk1.7.0 # Note, replace jdk1.7.0 with your java version!
set PATH=%PATH%;%MAVEN_HOME%\bin
You can also do this without using the command prompt by going to Control Panel/All Control Panel Items/System and then clicking on Advanced System Settings and from there going into the Advanced tab and hitting Environment Variables.
Once you've managed to open up your environment variables click on New and add a new variable to the System Variables section called MAVEN_HOME and set its path to wherever you've downloaded and extracted maven to. In my case again, it'll be C:/Program Files/Apache-Maven/3.2.1
. Now hit OK.
After you've added maven's environment variable we've got to add it to the PATH variable as well, to do that find the variable in the System Variables section and hit Edit. At the end of the PATH variable's path settings add in ;%MAVEN_HOME%/bin # Notice the ';'!
.
Exit out of your environment settings by hitting OK and Apply. You may need to close any open command prompts for changes to take effect.
Now lets check if we've got everything setup right! Enter the command:
mvn --version
If you get some back like Apache Maven 3.2.1 ...
you've successfully installed maven and are good to go!
Visit the site at tenjava.com
If you have any questions (about the contest, git, Maven etc), please don't hesitate to send us a tweet @tenjava or ask in our IRC channel.