Installing Maven on Ubuntu 10.10

Step 1:
Get Maven. Can download from any of the mirrors in this url.

Step 2:
From download directory unzip the downloaded maven distribution(e.g apache-maven-3.0.x.tar.gz) with the below command:

tar zxvf apache-maven-3.0.x.tar.gz


A directory called “apache-maven-3.0.x” will be created.

Step 3:
Copy the unziped folder and paste it in usr/local/src. Copy and paste can be done with the below command:

sudo cp -R apache-maven-3.0.3/ $home/usr/local/src


Step 4:
Configure Maven installation in linux environment variable list.

Environment variable disappears as soon as it has been set in the terminal. In order to keep it available in the ubuntu system it has to be included in the .bashrc file which is in the /home directory.

Open the bashrc file with the following command:

gedit ~/.bashrc


This will open the bashrc file in the gedit editor as below.

Go to the bottom of the file and add the below text in the editor:

export M2_HOME=/usr/local/src/apache-maven-3.0.3
export M2=$M2_HOME/bin
export PATH=$M2:$PATH


Then save and close the editor. Close that terminal to complete the configuration.

Step 5:
Test the configuration by execution the below command in a new terminal:

echo $M2_HOME


The result of the above would be as below sample:

maven environment variable
The installation is complete.

  1. I blog frequently and I seriously appreciate your content.

    This great article has really peaked my interest. I’m going to take a note of your website and keep checking for new details about once a week. I opted in for your RSS feed as well.

  1. No trackbacks yet.

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: