Eclipse 在groovy项目中创建junit时出错

Eclipse 在groovy项目中创建junit时出错,eclipse,macos,groovy,Eclipse,Macos,Groovy,我刚从下载了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 有谁能告诉我可能是什么问题吗?您必须将JUni

我刚从下载了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

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

您必须将JUnit JAR添加到类路径中。选择项目->生成路径->配置生成路径…->库->添加库->JUnit->下一步->JUnit 4->确定