. Advertisement .
..3..
. Advertisement .
..4..
I get an error
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
when trying to run Junit test in Eclipse. How to fix the java.lang.noclassdeffounderror: org/hamcrest/selfdescribing error? Please give me some advice.
The cause: This issue “java.lang.noclassdeffounderror: org/hamcrest/selfdescribing” is caused by the absence of
hamcrest-core-1.3.jar
from your classpath.Solution: To fix this, add hamcrest-core-1.3.jar to your classpath alongside junit-4.XX.jar. It will operate fine after adding to the classpath through command line.
Add
hamcrest-all-X.X.jar
to 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=