title: Why adding class path caused main class not found?
body: <p>I get a NoClassDefFoundError when trying to run a Java class without providing the proper class path. However when added the needed class path, java complaints it cannot find the main method. If you have any idea of what's happening here, please point me in the right direction. Thank you</p>
  
  <pre><code>$ java MyClass
  Exception in thread "main" java.lang.NoClassDefFoundError: cern/colt/matrix/DoubleMatrix1D
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
      at java.lang.Class.getMethod0(Class.java:2856)
      ... 6 more
  
  $ java -cp resources/colt.jar MyClass
  Error: Could not find or load main class MyClass
  </code></pre>