0

我刚刚从http://dist.springsource.org/release/GRECLIPSE/e4.2/下载了 eclipse4.2 的 groovy 插件 。我的系统上没有任何其他的 groovy 安装/库。我可以在我的机器上在 Eclipse 中运行 groovy 程序。但是,当我尝试导入 org.junit.Test时,出现以下错误。

Groovy:class org.junit.Test is not an annotation in @org.junit.Test
Groovy:unable to resolve class org.junit.Test

谁能告诉我可能是什么问题?

4

1 回答 1

1

您必须将 JUnit jar 添加到您的类路径中。选择一个项目 -> 构建路径 -> 配置构建路径... -> Librarires -> 添加库 -> JUnit -> 下一步 -> JUnit 4 -> 确定。

于 2013-06-03T15:43:34.413 回答