0

They suggested me to update scala so I did it:

$ scala -version
Scala code runner version 2.11.4 -- Copyright 2002-2013, LAMP/EPFL

But this error remains:

my_project $ sbt 
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from /home/alex/Documents/projects/android/my_app123/sub_project1/project
[info] Compiling 1 Scala source to /home/alex/Documents/projects/android/my_app123/sub_project1/project/target/scala-2.9.2/sbt-0.12/classes...
[error] error while loading CharSequence, class file '/usr/local/java/jdk1.8.0_05/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
[error] (bad constant pool tag 15 at byte 1501)
[error] one error found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

So the error is the same. And also for some reason it has ...target/scala-2.9.2/sbt-0.12/classes in it path, why is it using scala 2.9.2. I tried deleting the directory target but it appeared again with the same scala 2.9.2.

Incerteza
  • 32,326
  • 47
  • 154
  • 261

1 Answers1

1

The version of Scala installed on your system is irrelevant if you use sbt. What matters is that the following setting be present in your build.sbt file:

scalaVersion := "2.11.4"
sjrd
  • 21,805
  • 2
  • 61
  • 91
  • on my Mac machine it compiled without changing anything in the project. Why? – Incerteza Jan 09 '15 at 08:21
  • Because your Mac has a JDK 7? – sjrd Jan 09 '15 at 10:52
  • It didn't pan out and it keeps creating the folder `.../project/target/scala-2.9.2/sbt-0.12/classes...` – Incerteza Jan 09 '15 at 12:43
  • That's "normal": it's for sbt itself, and apparently your project uses sbt 0.12.something. That's quite old. I recommend upgrading to 0.13.5 at least. It might help ... or not. – sjrd Jan 09 '15 at 16:46