MAVEN_HOME, MVN_HOME or M2_HOME [duplicate] MAVEN_HOME, MVN_HOME or M2_HOME [duplicate] java java

MAVEN_HOME, MVN_HOME or M2_HOME [duplicate]


I've personally never found it useful to set M2_HOME.

What counts is your $PATH environment. Hijacking part of the answer from Danix, all you need is:

export PATH=/Users/xxx/sdk/apache-maven-3.0.5/bin:$PATH

The mvn script computes M2_HOME for you anyway for what it's worth.


M2_HOME (and the like) is not to be used as of Maven 3.5.0. See MNG-5607 and Release Notes for details.


Here is my Maven setup. You can use it as an example. You don't need anything else in order to use Maven.

M2_HOME is used for both Maven 2 and 3

export M2_HOME=/Users/xxx/sdk/apache-maven-3.0.5export M2=$M2_HOME/binexport MAVEN_OPTS="-Xmx1048m -Xms256m -XX:MaxPermSize=312M"export PATH=$M2:$PATH