Scala控制台无法运行

时间:2018-10-03 19:29:14

标签: java scala ubuntu-16.04

即使我将Java 8设置为默认版本,scala控制台也无法运行。以下是我遇到的错误:

    Exception in thread "main" java.lang.NoClassDefFoundError: javax/script/Compilable
at scala.tools.nsc.interpreter.ILoop.createInterpreter(ILoop.scala:118)
at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:911)
at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:909)
at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:909)
at scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:97)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:909)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

这些是已安装的Java版本:

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

Selection   Path                                 Priority  Status

 0         /usr/lib/jvm/java-9-oracle/bin/java       1091  auto mode
 1         /usr/bin/gij-4.8                          1048  manual mode
*2         /usr/lib/jvm/java-8-oracle/jre/bin/java   1081  manual mode
 3         /usr/lib/jvm/java-9-oracle/bin/java       1091  manual mode

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

谢谢。

0 个答案:

没有答案