0
votes

I'm using scala play-json to parse the keys from a simple json object from a string along the lines of

'{"test": "value", "hello": "world"}'

The code where I'm doing this looks like this:

val columns = Json.parse(value).as[JsObject].keys.toList

I was able to run this and get the result I wanted running the debugger in IntelliJ, so I know this code works fine. However, when I try to run sbt assembly on my project, I get a build error saying

Validation.scala:126: bad symbolic reference to java.time encountered in class file 'DefaultReads.class'.

[error] Cannot access term time in package java. The current classpath may be missing a definition for java.time, or DefaultReads.class may have been compiled against a version that's incompatible with the one found on the current classpath.

[error] val values = Json.parse(value).as[JsObject].keys.toList

I'm running jdk 1.8.0_111 so I shouldn't be having the issue I've found on other SO posts trying to use the play-json library.

I'm using sbt version 0.13.13, scala version 2.11.0, and (trying to use) play-json version 2.5.12

1
Make sure to clean your buildcchantep
@cchantep made sure I did that too, no luckScott Kruyswyk
Do you have the correct imports? Is the play version the same as the play-json? See stackoverflow.com/questions/29425950/…nmat

1 Answers

0
votes

The issue was I had set the global jdk intellij and the jdk for the project, but I had recently changed my JAVA_HOME to jdk 1.7 and never changed it back.

Thanks for the responses anyways!