Search code examples
javascalasbtcharsequence

Scala SBT fails - error while loading CharSequence (Scala 2.12.1, SBT 0.13.13)


i've seen that people are getting same error messages (error: error while loading CharSequence, class file '...\rt.jar(java/lang/CharSequence.class)' is broken (bad constant pool tag 15 at byte 1470) and the most commont fix was to downgrade or upgrade java / scala / sbt versions.

For example, one answer was

sbt 0.12.x does not support JDK8. Please migrate to sbt 0.13.x, the latest is 0.13.7

I am wondering - after all this time and version changes in java / scala / sbt - the issue was not solved and i need to downgrade java to 7? But downgrading is not a good option when java is installed and used system-wide.

So is there a solution to this?

CURRENT VERSIONS:

java - 1.8.0_121
scala - 2.12.1
sbt - not working (cannot load CharSequance)

Solution

  • Yep. You still have to downgrade java. Java 7 worked for me. However you can still have both versions (7 and 8) installed on your machine. Just change java path in environmental variable. Its not the most pretty solution. I know. Cant think of any better one.