当我尝试在Scala REPL中执行任何表达式时,它崩溃了。这里回溯
Exception in thread "Thread-1" Exception in thread "main" java.lang.InterruptedException
at java.util.concurrent.SynchronousQueue.put(SynchronousQueue.java:879)
at scala.tools.nsc.interpreter.SplashLoop.run(InteractiveReader.scala:77)
at java.lang.Thread.run(Thread.java:745)
java.lang.NoSuchMethodError: jline.console.completer.CandidateListCompletionHandler.setPrintSpaceAfterFullCompletion(Z)V
at scala.tools.nsc.interpreter.jline.JLineConsoleReader.initCompletion(JLineReader.scala:136)
at scala.tools.nsc.interpreter.jline.InteractiveReader.postInit(JLineReader.scala:51)
at scala.tools.nsc.interpreter.ILoop.$anonfun$process$4(ILoop.scala:899)
at scala.tools.nsc.interpreter.ILoop.$anonfun$process$4$adapted(ILoop.scala:897)
at scala.tools.nsc.interpreter.SplashReader.postInit(InteractiveReader.scala:130)
at scala.tools.nsc.interpreter.ILoop.$anonfun$process$5(ILoop.scala:926)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.tools.nsc.interpreter.ILoop.$anonfun$mumly$1(ILoop.scala:188)
at scala.tools.nsc.interpreter.IMain.beQuietDuring(IMain.scala:209)
at scala.tools.nsc.interpreter.ILoop.mumly(ILoop.scala:185)
at scala.tools.nsc.interpreter.ILoop.loopPostInit$1(ILoop.scala:908)
at scala.tools.nsc.interpreter.ILoop.$anonfun$process$11(ILoop.scala:979)
at scala.tools.nsc.interpreter.ILoop.startup$1(ILoop.scala:947)
at scala.tools.nsc.interpreter.ILoop.$anonfun$process$1(ILoop.scala:990)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:892)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:79)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:92)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:108)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
表达式示例:1 + 1
Scala:Scala code runner version 2.12.0 -- Copyright 2002-2016, LAMP/EPFL and Lightbend, Inc.
Java:
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)
操作系统:macOS 10.12
如何解决此问题?
答案 0 :(得分:0)
我尝试删除安装到操作系统的所有scala,然后安装brew中的最后一个scala版本。
命令如下所示:
brew uninstall sbt
brew uninstall scala
rm -rf /Application/Scala
brew upgrade
brew install scala
所以,这有助于我。