15
votes

I use Scala 2.10.0RC1 and sbt 0.12.1. What causes and how can I fix this runtime error (runs fine on 2.9.2)?

The exact error message is:

java.lang.NoSuchMethodError: scala.Predef$ArrowAssoc$.extension$$minus$greater(Ljava/lang/Object;Ljava/lang/Object;)Lscala/Tuple2;

1
Your code is compiled with value class support, but executed without it. Are you sure you are running it with scala 2.10.0 RC1 library?senia
i am using sbt 0.12.1 with these scala options Seq("-unchecked", "-deprecation", "-feature", "-language:reflectiveCalls","-language:implicitConversions", "-language:postfixOps", "-language:dynamics","-language:higherKinds","-language:existentials", "-language:experimental.macros"). I'm running the code (test) inside sbt. how do i verify that it's using the right library?user1779032
It's possible there is something like scalaVersion in Test := "2.9.2" in your Build.sbt file.senia
I remember having problems with sbt caching an old Scala version somewhere. After I removed ~/.sbt, ~/.ivy2 and ~/.m2 the problem was gone. Later on someone told me that sbt reboot would also help, but I didn't have a chance to try that out yet.Eugene Burmako
I just encountered the same problem and ended up deleting a folder that caches jar files for sbt-multi-jvm and that fixed my problem. I suggest searching your pc for files named -2.9 or 2.10.0-M. And just wipe them out.cessationoftime

1 Answers

10
votes

You're running the code with the wrong Scala version. This can have several causes:

  • misconfiguration of the project with sbt – search for 2.9.2 in config files
  • stale cache used by sbt – sbt reboot
  • something else?

If you meticulously check all your sbt configuration files for 2.9.2 and then wipe out all caches, things should run better. Dependencies usually have a version number in the name of the jar file, so running a find on your system will likely point you to the ones you missed.