title: Setting M2_HOME
body: <p>I use Intellij Idea. Now I'm trying to set up new system and have came up with the next issue:</p>
  
  <ol>
  <li>I've downloaded java, installed it, set <code>JAVA_HOME(C:\Progra~2\Java\jdk1.7.0_51)</code>, added to <code>PATH (C:\Progra~2\Java\jdk1.7.0_51\bin)</code>, checked from console <code>java -version</code> and <code>%JAVA_HOME%</code> - everything works fine (<code>java version "1.7.0_51"Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)</code>).</li>
  <li>I've downloaded maven, installed it, set <code>M2_HOME(C:\Progra~2\Java\maven)</code>, added to <code>PATH(C:\Progra~2\Java\maven\bin)</code>, checked from console <code>mvn -version(Apache Maven 3.3.3 2015-04-22T14:57:37+03:00) Maven home: C:\Progra~2\Java\maven Java version: 1.7.0_51, vendor: Oracle Corporation Java home: C:\Progra~2\Java\jdk1.7.0_51\jre Default locale: ru_RU, platform encoding: Cp1251 OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"</code>) and enter <code>cd %M2_HOME%</code> - it goes there normally.</li>
  </ol>
  
  <p>But when I try to do mvn -clean or -install or any other action from Intellij, it says:</p>
  
  <pre><code>-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
  Process finished with exit code 1
  </code></pre>