4
votes

I'm trying to use Miles Sabin's HList of his Shapeless project. So I installed sbt from Macports (this is version 0.11).

Unfortunately, when launching sbt, I have the following error message:

java.lang.IncompatibleClassChangeError: Expected static method scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
    at xsbt.boot.Boot$.runImpl(Boot.scala:24)
    at xsbt.boot.Boot$.main(Boot.scala:15)
    at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.lang.IncompatibleClassChangeError: Expected static method scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;

Search google seems to point that sbt-launch.jar would be in classpath. But even though I export CLASSPATH to "", I still have the issue.

I also directly downloaded the sbt-launch.jar from typesafe, and running with java -jar, with exactly the same problem.

Any idea? Other people having the same issue?

EDIT

I've tracked the problem down to a Java extension under ~/Library/Java/Extensions/scala-library.jar

I have removed it and the problem is gone. I think this has been installed by the TypeSafe stack (TBC).

2
Not solving your general problem, but: There is a runner script in the shapeless repo. Have you tried to run it as ./sbt?Debilski
Nope, haven't seen that using SBT on the Mac before. Is it possible you have an old or nonstandard Java for some reason? What do "which java" and "java -version" report?David Soergel
OSX5114:~ leo$ java -version java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)Leo
I've tried ./sbt first, but it raised the exact same issue. I've reported. I also directly have the problem when launching sbt-launch.jar. Very strange. I could finely use Shapeless, on a previous version, before it included its compiler plugin depending on sbt, so I could recompile within Eclipse.Leo
I was getting IncompatibleClassChangeError: Expected static method scala.Array$.unapplySeq before I removed some jar-s from /Library/Java/Extensions/ (scala-library.jar among them). I myself placed it there.idonnie

2 Answers

1
votes

I have had this error, and generally uninstalling Java, and installing it again will resolve it.

0
votes

OP posted:

I've tracked the problem down to a Java extension under ~/Library/Java/Extensions/scala-library.jar

I have removed it and the problem is gone. I think this has been installed by the TypeSafe stack (TBC).