Eclipse Scala-object junit不是包组织的成员

Eclipse Scala-object junit不是包组织的成员,eclipse,scala,junit,Eclipse,Scala,Junit,我在Coursera学习Scala课程 我有一个包含以下行的测试文件: import org.junit.runner.RunWith 在这里,我得到以下错误: Multiple markers at this line: - object junit is not a member of package org - object junit is not a member of package org 我的问题与此类似: 我按照答案添加到我的build.sbt: addSbtPlugin

我在Coursera学习Scala课程

我有一个包含以下行的测试文件:

import org.junit.runner.RunWith
在这里,我得到以下错误:

Multiple markers at this line:
- object junit is not a member of package org
- object junit is not a member of package org
我的问题与此类似:

我按照答案添加到我的
build.sbt

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
但是,当我在项目根文件夹内的scala控制台中运行eclipse时,我得到:

<console>:11: error: not found: value eclipse
       eclipse
:11:错误:未找到:值eclipse
日食

您需要将上面的行添加到项目文件夹中的
plugins.sbt
文件中,而不是
build.sbt
。如果它不存在,您应该创建它。

您不在scala控制台中运行eclipse任务,而是在sbt提示符下运行,或者直接在shell/DOS命令行上调用“sbt eclipse”。