title: Check $M2_HOME environment variable and mvn script match
body: <p>I just install a maven project into Eclipse.</p>
  
  <pre><code>Right click in the project -&gt; Run As -&gt; Maven clean  
  </code></pre>
  
  <p>I got this error</p>
  
  <pre><code>-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
  </code></pre>
  
  <p>but the variable is set, because going in the command line and typing set I see this:</p>
  
  <pre><code>M2_HOME=C:\PGM\apache-maven-3.3.3
  M2=C:\PGM\apache-maven-3.3.3\bin
  </code></pre>