title: NoClassDefFoundError after converting simple java project to maven project in eclipse
body: <p>I have a class that I coded in a standard java project in eclipse on OSX (Java 1.6).  The class uses classes and interfaces from another library.<br>
  I select the class, then do Run As > Java Application and all works well.</p>
  
  <p>After that I try to run my project as a Maven project and things start to get a little frustrating..  I summarise all the steps here hoping that someone will tell me what I am doing wrong:
  - From the standard java project I right click and did Configure > Convert to Maven project and clicked Finnish.  All good so far.</p>
  
  <ul>
  <li><p>Then Build Path > Configure Build Path > and add the folder that contains my project. Still good</p></li>
  <li><p>THEN I remove all the @Override annotations since I read somewhere on SO that Maven uses JDK 1.5 instead of 1.6.  Whatever, I remove them and my red flags go away.  At this point my class looks exactly like in the original java project (except for the @override that I removed)</p></li>
  <li><p>THEN I do Maven > clean.  I get build success</p></li>
  <li><p>THEN Maven > Install. I get a build success</p></li>
  <li><p>THEN I select my class and do Run As > Java Application and I get this ugly looking trace:</p>
  
  <p>Exception in thread "main" java.lang.NoClassDefFoundError: LMAXTrading/algos/HeartbeatClient
  Caused by: java.lang.ClassNotFoundException: LMAXTrading.algos.HeartbeatClient
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)</p></li>
  </ul>
  
  <p>I don't know where to go from here.  You can imagine that I went through a lot of trials and errors and searched on SO and elsewhere to find a way to get this to work.  But I just cannot figure out what is wrong. So if someone has an idea I am so ready to listen.</p>
  
  <p>I am pasting below my directory layout from the Navigator View as well as from the Package explorer view</p>
  
  <p><img src="https://i.stack.imgur.com/cEFoN.png" alt="layout Navigator view"></p>
  
  <p><img src="https://i.stack.imgur.com/PBcC5.png" alt="enter image description here"></p>
  
  <p>And here is the POM.xml where I have added the JRE config</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;someproject&lt;/groupId&gt;
    &lt;artifactId&gt;someproject&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.3.2&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.6&lt;/source&gt;
            &lt;target&gt;1.6&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>