錯誤信息: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
新聞熱點
疑難解答