Scala REPL 启动错误“类文件已损坏" [英] Scala REPL startup error "class file is broken"

查看:51
本文介绍了Scala REPL 启动错误“类文件已损坏"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次在启动 Scala 2.9.2 REPL (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0-ea) 后第一行代码执行都会给我一个错误:

Every time after starting Scala 2.9.2 REPL (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0-ea) first line of code executing bring me an error:

scala> 1 + 2
error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
(bad constant pool tag 15 at byte 1484)

稍后在当前 REPL 实例中的进一步评估期间没有发生类似的错误.

Later during further evaluation in current REPL instance no similar errors are occured.

有人对如何处理这种行为有任何建议吗?

Has anyone any suggestion how to handle this behaviour?

推荐答案

尝试选择其他替代提供程序 java:

Try to select other alternative provider java:

$ sudo update-alternatives --config java

替代java有一些选择(提供/usr/bin/java).

There are some choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-8-oracle/jre/bin/java          1071      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode
* 3            /usr/lib/jvm/java-8-oracle/jre/bin/java          1065      manual mode

Press enter to keep the current choice[*], or type selection number: 

Scala 现在可用于 Java 8 :-)

EDITED: Scala is now abailable for Java 8 :-)

http:///www.scala-lang.org/news/2013/09/18/release-notes-v2.10.3-RC2.html

这篇关于Scala REPL 启动错误“类文件已损坏"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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