错误信息:java.lang.NoClassDefFoundError orghamcrestSelfDescribing 错误原因: 去官网,发现这样一段话: 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.意思是到了4.11,在jar包中就不包括Hamcrest了。所以在引入junit-4.12进行junit测试时,就报错。 解决方法: 使用是导入包的方案:junit.jar + hamcrest-core.jar + hamcrest-library.jar 或者是:junit-dep.ajr+hancrest-all.jar
新闻热点
疑难解答