Apache Maven is one of the most popular software project management tools, which uses the concept of a project object model (POM). It has the ability to manage a project’s build, reporting and documentation from a central piece of information.

In order to work with Maven, you need to install Java first on your machine. Here, we have considered installing Java on the Windows machine.

Installing and Executing Java
  1. Download the JDK (Java Development Kit) from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. Once the download is over, install the executable file on your system.
  3. Set JAVA_HOME as an Environmental variable into your system, as shown below.

Follow the below-mentioned steps to do this.

    • Right-click on the My Computer icon from your desktop
    • Click on Properties
    • Select Advanced tab
    • Click Environment Variables button
    • User would see Environment Variables interface
    • Click New associated with System variables section
    • You would see New System Variable interface
    • Put JAVA_HOME into the variable name field
    • Path of your JDK into the variable value field, as into the above screen my JAVA Home directory is installed into C:\Program Files (x86)\Java\jdk1.8.0_71
    • Click Ok
    • Select the path and click on Edit button
    • Add path “C:\Program Files (x86)\Java\jdk1.8.0_71\bin”
  1. Check whether Java has been successfully installed on the system or not by running the following command from the command prompt:
Run java –version

Configuring Maven Build Tool
  1. Download the binary distribution of Ant from https://maven.apache.org/download.cgi
  2. Once the download is over, unzip the file in a directory, say C. Copy the same folder into C:\Program Files\JAVA folder as well, as shown below.

  1. Set the MAVEN_HOME path in an Environmental variable in your system as shown below.

Follow the below-mentioned steps to do this.

    • Right click on the My Computer icon from your desktop
    • Click on Properties
    • Select Advanced tab
    • Click Environment Variables button
    • The user would see Environment Variables interface
    • Click New associated with System variables section
    • You would see the New System Variable interface
    • Put MAVEN_HOME into the variable name field
    • Put the path of your Maven into the variable value field, as shown in the above screen. I have set the path of the Home directory as C:\apache-maven-3.5.3
    • Click Ok
    • In the System Variables, you would see variable Path, select the row, click Edit and define a path (C:\apache-maven-3.5.3 \bin) as shown in the below screen. I have set the path of ANT bin folder as C:\apache-maven-3.5.3 \bin
    • Click OK

Note: The above screenshot appears on window 10. However, the screen might differ if you work on other windows version like 7, 8, 8.1, etc. 

  1. Check whether Maven has been successfully installed on the system or not by running the following command from the command prompt:
Run mvn –version

You may also like: How to Configure Android and Devices on your Windows PC?

Leave a comment

Your email address will not be published. Required fields are marked *