Maven Installation Instructions


1- Download Maven library from the following URL At the time of writing this tutorial the latest version of Maven is 2.0.9. Download for Windows and apache-maven-2.0.9-bin.tar.gz from Linux platform.

2- Unzip the file at some proper location (in my case its C:\Program Files\Apache Software Foundation\apache-maven-2.0.9).

3- Make sure your JAVA_HOME environment variable is set to java home directory.

4- You need to setup two environment variables for Maven

a. M2_HOME

b. M2

For Windows:

Go to My Computer > Properties >Advance tab > Environment variables > Under User variables > New and provide both M2_HOME and M2 environment variables as shown in the following figures

See the figures below.

Setting maven Environment variables in windows

M2_HOME environment variableM2 environment variable

For Linux:

Go to your home directory > in the view menu, check “show hidden files”. Open “.bashrc” file in an editor like gedit.

At the end of the file add these three lines

export M2_HOME = Path_To_Maven_Home_Directory

export M2= Path_To_Maven_Bin_Directory

export PATH = $PATH: Path_To_Maven_Bin_Directory

Editing path env variable

5- You also need to update the PATH environment variable in order to access Maven commands from console. Go to My computer > properties > Advance tab > Click Environment Variable Button > under system variables find PATH variable > Click Edit and at the end provide the path up to the bin folder of Maven. In my case it is C:\Program Files\Apache Software Foundation\apache-maven-2.0.9\bin

6- To verify that every thing is setup according to the plan open console and type mvn –version. You should see something similar to the following figure.

See also: , Maven project home page, Download and detailed installation instructions., introduction to maven commands and building a web application in maven


One Response to “Maven Installation Instructions”

  1. 1 Getting Started with Maven (Creating a Java/Web/Eclipse project) « Technology is good

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: