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.
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:
The Java folder must contain the following subsirectory:
Set the JAVA_HOME Variable
Once you have the JDK installation path:
- Right-click My Computer icon on your desktop and select Properties.
- Click the Advanced tab, then click the Environment Variables button.
- Under System Variables, click New.
- Enter the variable name as JAVA_HOME.
- Enter the variable value as the installation path for the Java Development Kit.
- Click OK.
- Click Apply Changes.
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 –
step 3. Add M2_HOME and MAVEN_HOME
step 4. M2_HOME To PATH
Step 5. verify Maven
mvn –version in the command prompt.
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"
Apache Maven is installed successfully on Windows. Enjoy!!