[Solved] JUnit test error: Java lang.NoClassDefFoundError: org/hamcrest/SelfDescribing

Then Google checked and found that it was the problem with the version, and then reduced the version from 4.13 2 to 4.12 still can’t

Check Google again to change to version 4.10, or import hamcrest-core-1.3 jar

The official website says:

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.

 

So the solution is:

1. JUnit reduced version 4.10

2. Import hamcrest-core-1.3 jar

Similar Posts: