You need to add the following environtment variables (as user or system variables)
- M2_HOME (pointing to maven installation dir)
- JAVA_HOME (pointing to Java installation dir)
- Add %M2_HOME%\bin (WINDOWS) or $M2_HOME\bin (LINUX) to PATH environment variable
For example, this is my configuration on CentOS
export JAVA_HOME=/opt/java/jdk1.6.0_43
export PATH=${JAVA_HOME}/bin:${PATH}
export M2_HOME=/opt/apache/maven
export PATH=${M2_HOME}/bin:${PATH}
Then you can check using mvn --version
on your shell