加载CharSequence时出错(scala 2.11.4)

时间:2015-01-09 06:31:12

标签: linux scala sbt

他们建议我更新scala,所以我做了:

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

但是这个错误仍然存​​在:

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

所以错误是一样的。而且由于某种原因它在路径中有...target/scala-2.9.2/sbt-0.12/classes,为什么它使用scala 2.9.2。我尝试删除目录target,但它再次出现了相同的scala 2.9.2。

1 个答案:

答案 0 :(得分:1)

如果使用sbt,系统上安装的Scala版本无关紧要。重要的是build.sbt文件中存在以下设置:

scalaVersion := "2.11.4"