Unable to use ScalaCheck with Scala IDE for Eclipse

618 views Asked by At

I'm trying to follow the instructions in this guide http://lamp.epfl.ch/files/content/sites/lamp/files/teaching/progfun/ScalacheckTutorial.html in order to use ScalaCheck in Scala IDE.

However, when I create the first file StringSpecification.scala, with this code:

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)
    }
}

I get the following error in 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.

I'm using the latest stable version of Scla IDE (for Eclipse) (3.0.4), ScalaCheck (2.11-1.11.6) and Scala (2.11.2), and I'm running on Windows.

What could be causing this error?

1

There are 1 answers

0
DysproS On

When I added this jar to the project I was able to build the example files:

http://search.maven.org/#artifactdetails%7Corg.scala-lang.modules%7Cscala-parser-combinators_2.11%7C1.0.2%7Cbundle