【发布时间】:2013-01-10 10:27:55
【问题描述】:
在eclipse 中运行junit 测试时,我得到了这个Exception:
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
我已经添加了junit.jar 库文件。
我尝试过不同版本的 junit.jar:4.4、4.8 等。
如何解决这个异常?
【问题讨论】:
-
根据您的描述,
junit.jar与问题无关 -
harcrestjar 中的层次结构是否相同?和org > hamcrest > SelfDescribing一样,还是在jar的根目录下? -
这个错误可能不是junit jar,可能你的项目中有些东西需要其他jar,这里有一些org.hamcrest.SelfDescribing - known versions
-
谢谢,但我在项目中没有其他内容,我已经创建了这个新项目。
标签: java eclipse junit noclassdeffounderror hamcrest