user1779032
user1779032

Reputation: 496

How to fix NoSuchMethodError?

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;

Upvotes: 15

Views: 13850

Answers (1)

iwein
iwein

Reputation: 26161

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.

Upvotes: 10

Related Questions