java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing

eclipse, hamcrest, java, junit, noclassdeffounderror

Solution

Add `hamcrest-all-X.X.jar` to your classpath.

Latest version as of Feb 2015 is 1.3: http://code.google.com/p/hamcrest/downloads/detail?name=hamcrest-all-1.3.jar&can=2&q=

Problem

While running `junit` test in `eclipse` I am getting this `Exception`: ``` java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing ``` I've added `junit.jar` library file. I've tried different versions of junit.jar: `4.4`, `4.8`, etc. How do I fix this Exception?

Original source

Related problems