Jar: junit-4.12.jar: junit-4.12.jar: junit-4.12.jar: Junit-4.12.jar: Junit-4.12.jar: Junit-4.12.jar: Junit-4.12.jar: Java. Lang. NoClassDefFoundError: org/hamcrest/SelfDescribing.
Later, I found out that some people said to switch to a lower version and introduce junit4.10.jar. And it did, but we need to know why and only why
Check the website: JUnit now uses the latest version of Hamcrest. Thus, you can use all the available matchers and benefit from an improved assertThat which will now print the mismatch description from the matcher when an assertion fails.
junit.jar: Includes the Hamcrest classes. The simple All-in-one solution to get started quickly.Starting with Version 4.11, Hamcrest is no longer included in this jar. junit-dep.jar: Only includes the JUnit classes but not Hamcrest. Lets you use a different Hamcrest version. Note that the underlined part in black means that hamcrest is not included in versions 4.11 and above.
So there are two solutions:
2. Import hamcrest-core-1.3.jarCopy the code