0

I downloaded the scalafx-ensemble project. When I run sbt in the project's folder I'm facing the following error:

[info] Set current project to scalafxEnsemble (in build file:/C:/dev/sample/scalafx-ensemble-master/)
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
    at jline.TerminalFactory.create(TerminalFactory.java:101)
    at jline.TerminalFactory.get(TerminalFactory.java:159)
    at sbt.JLine$.sbt$JLine$$terminal(LineReader.scala:87)
    at sbt.JLine$.withTerminal(LineReader.scala:91)
    at sbt.JLine$.usingTerminal(LineReader.scala:97)
    at sbt.JLine$.createReader(LineReader.scala:103)
    at sbt.FullReader.<init>(LineReader.scala:135)
    at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:149)
    ...
    java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
    at sbt.JLine$$anonfun$usingTerminal$1.apply(LineReader.scala:98)
    at sbt.JLine$$anonfun$usingTerminal$1.apply(LineReader.scala:97)
    at sbt.JLine$.withTerminal(LineReader.scala:92)
    at sbt.JLine$.usingTerminal(LineReader.scala:97)
    at sbt.JLine$.createReader(LineReader.scala:103)
    at sbt.FullReader.<init>(LineReader.scala:135)
    at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:149)
    at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:146)
    at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:31)
    at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:31)
    at sbt.Command$.process(Command.scala:95)
    at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:100)
    ...
[error] java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
[error] Use 'last' for the full log.

If I run sbt run I'm getting the following:

    at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3193)
    at scala.tools.nsc.typechecker.Typers$Typer.handleOverloaded$1(Typers.scala:3190)
    at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3193)
    at scala.tools.nsc.typechecker.Typers$Typer.handleOverloaded$1(Typers.scala:3190)
[error] (compile:compile) java.lang.StackOverflowError
[error] Total time: 9 s, completed Jan 6, 2014 4:47:49 PM

What am I doing wrong?

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
falcon
  • 372
  • 3
  • 19

2 Answers2

1

This is likely problem with outdated SBT launcher. Make sure that your SBT is v.0.13 or newer.

Jarek
  • 1,513
  • 9
  • 16
  • Thanks. I've solved this problem. It was a wrong path. In my system JAVA_HOME is 'C:\Program Files\Java\jre7' like a standard path of Java windows installer. In 'build.sbt' path to 'jfxrt.jar' is '%JAVA_HOME%+jre/lib/jfxrt.jar' and it's wrong in my environment. – falcon Jan 08 '14 at 07:24
  • Sorry. You were right. SBT version it was a one of a problems. – falcon Jan 08 '14 at 16:18
0

I fixed the path to jfxrt.jar in build.sbt from

System.getenv("JAVA_HOME") + "jre/lib/jfxrt.jar"

to

System.getenv("JAVA_HOME") + "/lib/jfxrt.jar"

which is correct for my system. With the change, sbt run works fine.

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
falcon
  • 372
  • 3
  • 19
  • What about the error `IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected`? Did that go away, too?! [It looks the project uses 0.13.1](https://github.com/scalafx/scalafx-ensemble/blob/master/project/build.properties). – Jacek Laskowski Jan 07 '14 at 22:23
  • No. only 'sbt run' work fine. If i try to run 'sbt' i still get errors . – falcon Jan 08 '14 at 14:58
  • Sorry. I was a little bit confused by SBT versions. I've removed old SBT 1.12.1 and install latest version 1.13.1 which is defined in build. Finally all work fine. Thanks! – falcon Jan 08 '14 at 16:11
  • It means that the solution is a combination of your and @Jarek's answers, isn't it? You had to use the proper version of SBT and change the path to `jfxrt.jar`. Correct? – Jacek Laskowski Jan 08 '14 at 22:15