title: "Exception in thread "main" java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing"
body: <p>On my Ubuntu, I run an java executable, with error about some package I didn't explicitly use in my code. What might be the solution? Thanks.</p>
  
  <pre><code>$ java -cp .:/home/tim/program_files/programming/java/junit-4.11.jar MyTest
  Exception in thread "main" java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
  at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  at org.junit.runner.Computer.getSuite(Computer.java:28)
  at org.junit.runner.Request.classes(Request.java:75)
  at org.junit.runner.JUnitCore.run(JUnitCore.java:128)
  at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:73)
  at MyTest.main(MyTest.java:13)
  Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  ... 17 more
  </code></pre>