Site icon TestingDocs.com

Setup MAVEN_HOME on Windows 10

Setup MAVEN_HOME on Windows

This tutorial will set up Maven on the Windows 10 operating system. Maven depends on JDK, so make sure you have JDK installed on your computer. Setup involves downloading files, extracting them, and setting up the MAVEN_HOME environment variable.

Download Maven

Navigate to the following URL on a web browser:

Download the zip archive file:

apache-maven-<version>-bin.zip

Extract the contents

Save the file on your computer.

Extract the contents to a favorable directory using 7zip or a similar utility.

For example, to c:\maven

Set MAVEN_HOME

MAVEN_HOME is an environment variable that should point to the install directory of the Maven tool setup. Some inbuilt scripts use this variable. It’s important to set up this variable for the smooth running of the Maven tool.

Ask Cortana or key in “Edit the system environment variables” in the search bar.

 

 

In the Advanced Tab >> Click on the Environment Variables… button.

 

 

New Variable

Click on the New… button to create a new environment variable. Add a MAVEN_HOME variable and point it to the c:\maven directory. Click on the OK button.

Add the Maven bin folder to the PATH variable.

Select the PATH variable in the user variables. Click on the Edit… button.

Click on New and add %MAVEN_HOME%\bin  to the PATH. Click on the OK button.

Verify the setup

You can try a bunch of commands to verify the setup. To verify the maven setup, launch the command shell, and type

/> mvn -version

You should see the version information.

C:>mvn -version

C: Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
2017-04-04T01:09:06+05:30) Maven home: C:\maven\bin\.. Java version: 1.8.0_191, vendor: Oracle Corporation Java home: C:Program FilesJavajdk1.8.0_191jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "x86", family: "windows"

 

To know that the MAVEN_HOME is set, issue the following command in the command prompt:

c:> echo %MAVEN_HOME%

The output should display the Maven folder path. We have set up MAVEN_HOME and added it to the PATH variable so that you can work from any directory path regardless of the Maven setup.

Maven Tutorials

Maven Tutorials on this website can be found at:

For more information on Maven: 

 

Exit mobile version