2

I'm studying Play Framework 2.x and I have installed the framework, with the activator 1.2.3, on my Fedora FC20. Now I'm facing a strange error on launching the activator new, that never happened before. I've tried with java-1.7.0-openjdk-1.7.0.65-2.5.1.2.fc20.i386 and also with openjedk 1.8.0, but this error is still here.

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
sentenza
  • 1,608
  • 3
  • 29
  • 51

1 Answers1

4

You can try to delete and recreate your local repo (not quite sure which one applies to you):

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

Also, there was a play clean command before they switched to the activator. There should be something like activator clean now. After this you can try with activator compile.

Edit: as @sentenza pointed out, removing ~/.sbt was the correct step which solved the problem. I will still leave the other options above as they might work for somebody else.

Anton Sarov
  • 3,712
  • 3
  • 31
  • 48
  • There are two commands: `activator clean` and `activator clean-files`, but they do not do the trick. I have only a `~/.ivy2` folder. I purged the cache subdir, but nothing appreciable happens. – sentenza Jul 25 '14 at 10:25
  • @sentenza Try running `sbt clean`. If it doesn't work, you can also try something like [this](http://www.scala-sbt.org/0.7.7/docs/Troubleshooting.html) and even deleting ~/.sbt/ (or at least moving it) - I am on Windows and found `org.fusesource.jansi` under `.sbt/boot`. Also I recommend working in a directory with read and write rights – Anton Sarov Jul 25 '14 at 10:47
  • Removing `~/.sbt` folder fixed my dependency problem. Edit your response and I will accept it. – sentenza Jul 25 '14 at 12:24
  • I had this problem when using intellij's SBT shell; running it in the system SBT somehow avoided the issue. – bbarker Mar 11 '21 at 19:16
  • Deleting `~/.sbt` did not help me.:( – ehsun7b Sep 12 '22 at 04:07