title: Maven error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
body: <p>I have installed a latest <code>maven-3.0.4</code> on <em>Windows 7</em>:<br>
  The installation details are as follows:<br>
  Installation Path :  </p>
  
  <pre><code>C:\apache-maven-3.0.4  
  </code></pre>
  
  <p>Environment Variables are:  </p>
  
  <pre><code>M2_HOME C:\apache-maven-3.0.4\apache-maven\src  
  JAVA_HOME C:\Program Files\Java\jdk-1.7.0_04  
  </code></pre>
  
  <p>Path variables added are:  </p>
  
  <pre><code>%M2_HOME%\bin;%JAVA_HOME%\bin;
  </code></pre>
  
  <p>In the command window it shows it like this:  </p>
  
  <pre><code>C:\&gt;java -version  
  java version "1.7.0_04"  
  Java(TM) SE Runtime Environment (build 1.7.0_04-b22)  
  Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)  
  C:\&gt;mvn -version  
  Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher  
  </code></pre>
  
  <p>This is the only version on maven installed on my PC and the solution given on many blogs referring to the deletion of the previous <code>M2_HOME</code> environment variable is not valid. </p>
  
  <p>I have read and tried all the solutions given at blogs such as : </p>
  
  <ul>
  <li><a href="https://blogs.oracle.com/sreekanth/entry/java_lang_noclassdeffounderror_org_codehaus" rel="noreferrer">oracle blog</a>,  </li>
  <li><a href="https://stackoverflow.com/questions/8139115/new-maven-install-mvn-version-java-lang-classnotfoundexception">stackoverflow question</a>,  </li>
  <li><a href="https://stackoverflow.com/questions/6305795/problems-setting-up-maven">another stack question</a>,  </li>
  <li><a href="http://www.permeance.com.au/web/terry.mueller/home/-/blogs/maven2-reports-java-lang-noclassdeffounderror:-org-codehaus-classworlds-launcher" rel="noreferrer">some blog</a>,  </li>
  </ul>
  
  <p>but still not able to get to it. What I might be missing in this whole thing? Thanks in advance. </p>