Maven installation

Before installing Apache Maven you have to have Java installed on you machine. If you didn't do this yet or you are unsure whether Java is working on your machine go to the wiki page Install_Java, install Java and come back here.

Apache Maven is a build tool, just like make for C or Fortran.

Download maven

Go to the web page http://maven.apache.org/download.cgi look for the newest version and download it (Binary tar.gz will do). Here is the direct link for the newest version while working on this tutorial http://apache.mirror.triple-it.nl/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz

Unpack the file to the folder where you store your programs. Let's say that you uncompressed the file to the folder:

$HOME/programs/apache-maven/

Install maven

Installation of the Apache Maven software is very simple. One has to add only one folder to the $PATH system variable.

Installation od Apache Maven in BASH

Type in the console:

export PATH=$HOME/programs/apache-maven/bin/:$PATH

This will work only for the current console session. If you like to make it permanent add this command at the end of your BASH starting script:

$HOME/.bashrc

Installation od Apache Maven in CSH/TCSH

Type in the console:

setenv PATH $HOME/programs/apache-maven/bin/:$PATH

This will work only for the current console session. If you like to make it permanent add this command at the end of your BASH starting script:

$HOME/.cshrc

Testing maven

To check if maven is running properly just type in the console:

$ mvn --version
Picked up _JAVA_OPTIONS: -Xmx512m
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: /home/ahypki/programy/apache-maven
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /home/ahypki/programy/jdk1.7.0_21/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.12.2.el6.x86_64", arch: "amd64", family: "unix" 

If you see something similar then maven is running properly. Congrats!