title: mvn command not found in OSX Mavericks
body: <p>Before marking this as duplicate, I went through these posts, but nothing helped.</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/13697874/mvn-is-not-recognized-as-an-internal-or-external-command?rq=1">&#39;mvn&#39; is not recognized as an internal or external command,</a></li>
  <li><a href="https://stackoverflow.com/questions/1606174/getting-bash-mvn-command-not-found">Getting -bash: mvn: command not found</a>,</li>
  <li><a href="https://stackoverflow.com/questions/20029934/cant-access-mvn-command-from-command-line">Can&#39;t access mvn command from command line?</a></li>
  </ul>
  <p>Some are specific to windows and did not help. A couple of them on Mac OS X gave suggestions, that I tried but did not help.</p>
  <p>What I tried (this is exactly what <code>Maven</code> suggests):</p>
  <blockquote>
  <p>Extract the distribution archive, i.e. apache-maven-3.1.1-bin.tar.gz
  to the directory you wish to install Maven 3.1.1. These instructions
  assume you chose /usr/local/apache-maven. The subdirectory
  apache-maven-3.1.1 will be created from the archive. In a command
  terminal, add the M2_HOME environment variable, e.g. export
  M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1. Add the M2
  environment variable, e.g. export M2=$M2_HOME/bin. Optional: Add the
  MAVEN_OPTS environment variable to specify JVM properties, e.g. export
  MAVEN_OPTS=&quot;-Xms256m -Xmx512m&quot;. This environment variable can be used
  to supply extra options to Maven. Add M2 environment variable to your
  path, e.g. export PATH=$M2:$PATH. Make sure that JAVA_HOME is set to
  the location of your JDK, e.g. export JAVA_HOME=/usr/java/jdk1.5.0_02
  and that $JAVA_HOME/bin is in your PATH environment variable. Run mvn
  --version to verify that it is correctly installed.</p>
  </blockquote>
  <p>I see that on the <code>terminal</code> that I used for installation, it works fine. I do not have this issue. but when I tried on a new <code>terminal</code>, I get <code>command not found</code>.</p>
  <p>I also added <code>export PATH=$M2</code> to my <code>.bashrc</code>, I did <code>source</code> and then restarted the terminal, still it did not help.</p>
  <p>can someone suggest how to make it available in all sessions of terminal?</p>
  <p>Thanks</p>