Scala Error starting REPL "class file violated"

Every time after starting Scala 2.9.2 REPL (Java HotSpot (TM) 64-bit server VM, Java 1.8.0-ea), the first line of code execution causes 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) 

Later, during a further evaluation, there were no such errors in the current REPL instance.

Does anyone have any suggestions on how to handle this behavior?

+18
scala read-eval-print-loop
Sep 17 '13 at 6:45
source share
1 answer

Try choosing another alternative java provider:

 $ sudo update-alternatives --config java 

There are several alternative java options (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: 

Revision: Scala is now available for Java 8 :-)

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

+21
Apr 22 '14 at 11:01
source share
— -



All Articles