scala - 无法将 ScalaCheck 与 Scala IDE for Eclipse 结合使用

标签 scala scala-ide scalacheck

我正在尝试按照本指南 http://lamp.epfl.ch/files/content/sites/lamp/files/teaching/progfun/ScalacheckTutorial.html 中的说明进行操作 为了在 Scala IDE 中使用 ScalaCheck。

但是,当我使用以下代码创建第一个文件 StringSpecification.scala 时:

package pp.scalacheck

import org.scalacheck._
import Prop.forAll
object StringSpecification extends Properties("String") {
    property("startsWith") = forAll { (x: String, y: String) =>
        (x + y).startsWith(x)
    }
}

我在 Scala IDE 中收到以下错误:

bad symbolic reference to scala.util.parsing encountered in class file 'CmdLineParser.class'. Cannot access term parsing in package scala.util. The current classpath may be missing a definition for scala.util.parsing, or CmdLineParser.class may have been compiled against a version that's incompatible with the one found on the current classpath. (NOTE: It looks like the scala-parser-combinators module is missing; try adding a dependency on "org.scala-lang.modules" : "scala-parser-combinators". See http://docs.scala-lang.org/overviews/core/scala-2.11.html for more information.)

Error in Scala compiler: bad symbolic reference to scala.util.parsing.combinator encountered in class file 'CmdLineParser.class'. Cannot access term combinator in value scala.util.parsing. The current classpath may be missing a definition for scala.util.parsing.combinator, or CmdLineParser.class may have been compiled against a version that's incompatible with the one found on the current classpath. (NOTE: It looks like the scala-parser-combinators module is missing; try adding a dependency on "org.scala-lang.modules" : "scala-parser-combinators". See http://docs.scala-lang.org/overviews/core/scala-2.11.html for more information.)

SBT builder crashed while compiling. The error message is 'bad symbolic reference to scala.util.parsing.combinator encountered in class file 'CmdLineParser.class'. Cannot access term combinator in value scala.util.parsing. The current classpath may be missing a definition for scala.util.parsing.combinator, or CmdLineParser.class may have been compiled against a version that's incompatible with the one found on the current classpath. (NOTE: It looks like the scala-parser-combinators module is missing; try adding a dependency on "org.scala-lang.modules" : "scala-parser-combinators". See http://docs.scala-lang.org/overviews/core/scala-2.11.html for more information.)'. Check Error Log for details.

我使用的是最新稳定版本的 Scla IDE(适用于 Eclipse)(3.0.4)、ScalaCheck (2.11-1.11.6) 和 Scala (2.11.2),并且我在 Windows 上运行。

什么可能导致此错误?

最佳答案

关于scala - 无法将 ScalaCheck 与 Scala IDE for Eclipse 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26957488/

相关文章:

scalac 在 ScalaTest 测试中发现错误的 forAll 方法

scala - IntelliJ : Command Line is too Long. 在 SBT 项目中缩短...的命令行

scala - 如何从 Scala 公共(public) API 中屏蔽实现级别的类、特征和对象?

scala - 停止 Scala 2.11.4 REPL 中无限循环的执行?

java - Eclipse 无法使用 Scala IDE 识别 TODO/FIXME 注释

eclipse - Scala println 在 IDE 中终止时不起作用

java - 在 Java 中随机生成*有趣的*字符串

testing - scalacheck 中常规类的生成器

scala - 使用 UDF 的 DataFrame 给出任务不可序列化异常

java - Scala IDE - Play 2 Eclipse 插件不突出显示 Scala HTML 模板的语法