我正在尝试按照本指南 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 上运行。
什么可能导致此错误?
最佳答案
当我将此 jar 添加到项目中时,我能够构建示例文件:
关于scala - 无法将 ScalaCheck 与 Scala IDE for Eclipse 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26957488/