加载 CharSequence 时出错(scala 2.11.4) [英] error while loading CharSequence (scala 2.11.4)

查看:36
本文介绍了加载 CharSequence 时出错(scala 2.11.4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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.

推荐答案

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

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"

这篇关于加载 CharSequence 时出错(scala 2.11.4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆