Play 2.3 出现了 DefaultReads 的不兼容错误

Play 2.3 got incompatible errors for DefaultReads

我正在尝试将游戏从 2.2 更新到 2.3,但我遇到了几个错误,抱怨 DefaultReads 不兼容。

[error] Could not access term time in package java,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'DefaultReads.class' was compiled against an incompatible version of java.
[error]       (jsObj \ "items").asOpt[JsArray] match {

问题是播放缓存依赖性。我不应该使用最新的。我用了Play版配套的后就可以了

"com.typesafe.play" % "play-cache_2.11" % "2.3.8"

正如@richard-close 所建议的,在我的案例中,这个问题是由 sbt 使用的 jdk7 引起的。

你可以用

检查一下
sbt
> eval System.getProperty("java.version")
[info] ans: String = 1.7.0_80
> eval System.getProperty("java.home")
[info] ans: String = /usr/lib/jvm/java-7-oracle/jre