How to install Maven on Windows




Maven_logo.svg

installing Maven on Windows

Maven is a command-line tool made for building Java (and also other) programs. We can install maven using a simple ZIP file containing a pre-compiled version of Maven for our convenience. There is no Maven installer.

In order to install maven we need to fulfill some prerequisites and set environment to run it on Windows.

Prerequisites

Maven is written in Java (and mainly used to build Java codes). So, the major prerequisite is the Java SDK.

 

Step 1. setting JAVA_HOME

Make sure that Java is installed in your windows operating system. Then set the Windows environment variable called “JAVA_HOME” as shown below :

Open the default installation path if the Java JDK:

C:\Program Files\Java

The Java folder must contain the following subsirectory:

C:\Program Files\Java\jdk1.6.0_10

Set the JAVA_HOME Variable

Once you have the JDK installation path:

  1. Right-click My Computer icon on your desktop and select Properties.
  2. Click the Advanced tab, then click the Environment Variables button.
  3. Under System Variables, click New.
  4. Enter the variable name as JAVA_HOME.
  5. Enter the variable value as the installation path for the Java Development Kit.
  6. Click OK.
  7. Click Apply Changes.

Set the JAVA_HOME Variable

 

Step 2. Downloading Apache Maven

Open the Maven official website and download the Maven zip file, e.g. apache-maven-3.3.9-bin.zip. Unzip the zip to the folder of you choice.

Let’s say we unzip to this folder – C:\apache-maven-3.3.9

apache-maven

 

step 3. Add M2_HOME and MAVEN_HOME

Add M2_HOME and MAVEN_HOME

step 4. M2_HOME To PATH

Add %M2_HOME%\bin to PATH variable,  so that you can run the Maven’s command line from anywhere.
M2_HOME To PATH

 

Step 5. verify Maven

run mvn –version in the command prompt.

C:\Users\codebind>mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: C:\apache-maven-3.3.9
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk8\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"

C:\Users\codebind>

verify maven

 

Apache Maven is installed successfully on Windows. Enjoy!!

Video Instructions


Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com





Be the first to comment

Leave a Reply

Your email address will not be published.


*