PlayFramework 2.3.1 NoClassDefFoundError:org / fusesource / jansi / AnsiOutputStream

时间:2014-07-25 09:04:13

标签: scala playframework-2.0

我正在学习Play Framework 2.x,我在我的Fedora FC20上安装了激活器1.2.3的框架。现在我在启动activator new时面临一个奇怪的错误,这在以前从未发生过。我已尝试使用java-1.7.0-openjdk-1.7.0.65-2.5.1.2.fc20.i386以及openjedk 1.8.0,但此错误仍然存​​在。

java.lang.NoClassDefFoundError: org/fusesource/jansi/AnsiOutputStream
    at jline.console.ConsoleReader.stripAnsi(ConsoleReader.java:479)
    at jline.console.ConsoleReader.setPrompt(ConsoleReader.java:398)
    at jline.console.ConsoleReader.readLine(ConsoleReader.java:2172)
    at jline.console.ConsoleReader.readLine(ConsoleReader.java:2126)
    at sbt.JLine.sbt$JLine$$readLineDirectRaw(LineReader.scala:45)
    at sbt.JLine$$anonfun$readLineDirect$2.apply(LineReader.scala:37)
    at sbt.JLine$$anonfun$readLineDirect$2.apply(LineReader.scala:37)
    at sbt.Signals0.withHandler(Signal.scala:87)
    at sbt.Signals$.withHandler(Signal.scala:13)
    at sbt.JLine.readLineDirect(LineReader.scala:37)
    at sbt.JLine.readLineWithHistory(LineReader.scala:32)
    at sbt.JLine.sbt$JLine$$unsynchronizedReadLine(LineReader.scala:20)
    at sbt.JLine$$anonfun$readLine$1.apply(LineReader.scala:17)
    at sbt.JLine$$anonfun$readLine$1.apply(LineReader.scala:17)
    at sbt.JLine$$anonfun$withJLine$1.apply(LineReader.scala:118)
    at sbt.JLine$$anonfun$withJLine$1.apply(LineReader.scala:116)
    at sbt.JLine$.withTerminal(LineReader.scala:92)
    at sbt.JLine$.withJLine(LineReader.scala:116)
    at sbt.JLine.readLine(LineReader.scala:17)
    at activator.ActivatorCliHelper$class.readLine(ActivatorCliHelper.scala:19)
    at activator.TemplateHandler$.readLine(TemplateHandler.scala:16)
    at activator.TemplateHandler$.getTemplateName(TemplateHandler.scala:81)
    at activator.ActivatorCli$$anonfun$apply$1.getTemplateName$1(ActivatorCli.scala:55)
    at activator.ActivatorCli$$anonfun$apply$1.apply$mcI$sp(ActivatorCli.scala:89)
    at activator.ActivatorCli$$anonfun$apply$1.apply(ActivatorCli.scala:19)
    at activator.ActivatorCli$$anonfun$apply$1.apply(ActivatorCli.scala:19)
    at activator.ActivatorCli$.withContextClassloader(ActivatorCli.scala:179)
    at activator.ActivatorCli$.apply(ActivatorCli.scala:19)
    at activator.ActivatorLauncher.run(ActivatorLauncher.scala:28)
    at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
    at xsbt.boot.Launch$.withContextLoader(Launch.scala:129)
    at xsbt.boot.Launch$.run(Launch.scala:109)
    at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:36)
    at xsbt.boot.Launch$.launch(Launch.scala:117)
    at xsbt.boot.Launch$.apply(Launch.scala:19)
    at xsbt.boot.Boot$.runImpl(Boot.scala:44)
    at xsbt.boot.Boot$.main(Boot.scala:20)
    at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.AnsiOutputStream
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 38 more
Error during sbt execution: java.lang.NoClassDefFoundError: org/fusesource/jansi/AnsiOutputStream

1 个答案:

答案 0 :(得分:4)

您可以尝试删除并重新创建本地仓库(不太确定哪一个适用于您):

~/.m2/repository
~/.ivy2/cache
~/.ivy/cache

此外,在切换到play clean之前,有一个activator命令。现在应该有类似activator clean的东西。在此之后,您可以尝试使用activator compile

编辑:正如@sentenza指出的那样,删除~/.sbt是解决问题的正确步骤。我仍然会留下上面的其他选项,因为它们可能适用于其他人。