2
votes

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
Your error says: NOTE: It looks like the scala-parser-combinators module is missing; try adding a dependency on "org.scala-lang.modules" : "scala-parser-combinators". See docs.scala-lang.org/overviews/core/scala-2.11.html for more information.)' Did you do that?Diego Martinoia
I couldn't find scala-parser-combinators the last time I looked. However, I tried again and found this site which solved the problem: search.maven.org/… Thanks!DysproS

1 Answers