jerome
jerome

Reputation: 2089

Running a Play! Project using the new sbt and jdk 9

I'm trying to run a Scala Play! project, I have jdk 9 installed. I tried to create the project both ways with the starter project and using sbt. sbt compile works fine, but sbt run throws an exception.

I downloaded the play-scala-start-example.zip from this page http://developer.lightbend.com/start/?group=play, unzip it in a folder then cd to that folder and sbt run gives me the following error:

    java.lang.NumberFormatException: Not a version: 9
    at scala.util.PropertiesTrait$class.parts$1(Properties.scala:176)
    at scala.util.PropertiesTrait$class.isJavaAtLeast(Properties.scala:180)
    at scala.util.Properties$.isJavaAtLeast(Properties.scala:16)
    at play.dev.filewatch.FileWatchService$$anon$1.delegate$lzycompute(FileWatchService.scala:68)
    at play.dev.filewatch.FileWatchService$$anon$1.delegate(FileWatchService.scala:66)
    at play.dev.filewatch.FileWatchService$$anon$1.watch(FileWatchService.scala:79)
    at play.runsupport.Reloader.<init>(Reloader.scala:359)
    at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:220)
    at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:220)
    at play.runsupport.Reloader$.startDevMode(Reloader.scala:230)
    at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:77)
    at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:77)
    at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
    at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:63)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.NumberFormatException: Not a version: 9

Solved: It is working perfectly with the jdk 1.8.0_121 I have installed some time ago.

Upvotes: 3

Views: 954

Answers (1)

Spenhouet
Spenhouet

Reputation: 7169

Java 9 released today and I changed my Play project from Java 1.8 to 9.

I then found that scala doesn't support JDK 9 yet and that it's just not possible to build Play with JDK 9.

It seems that the work on scala supporting JDK 9 has started:

https://github.com/scala/scala-dev/issues/139

Just sad that it doesn't work on release.

Upvotes: 2

Related Questions