0

我想当我尝试使用 Play Framework + Slick + HikariCP 时,我遇到了某种兼容性错误类:

play.api.UnexpectedException: Unexpected exception[UnsupportedClassVersionError: com/zaxxer/hikari/HikariConfig : Unsupported major.minor version 52.0]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:170) ~[play_2.11-2.3.7.jar:2.3.7]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.3.7.jar:2.3.7]
    at scala.Option.map(Option.scala:146) ~[scala-library-2.11.6.jar:na]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.3.7.jar:2.3.7]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:128) ~[play_2.11-2.3.7.jar:2.3.7]
    at scala.util.Success.flatMap(Try.scala:230) ~[scala-library-2.11.6.jar:na]
    at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:128) ~[play_2.11-2.3.7.jar:2.3.7]
    at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:120) ~[play_2.11-2.3.7.jar:2.3.7]
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[scala-library-2.11.6.jar:na]
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) ~[scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) ~[scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) ~[scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) ~[scala-library-2.11.6.jar:na]
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) ~[scala-library-2.11.6.jar:na]
Caused by: java.lang.UnsupportedClassVersionError: com/zaxxer/hikari/HikariConfig : Unsupported major.minor version 52.0

这就是我在我的 sbt 中所拥有的:

"com.typesafe.slick" %% "slick" % "3.0.0",
"org.postgresql" % "postgresql" % "9.4-1201-jdbc4",
"com.zaxxer" % "HikariCP" % "2.3.7"

我正在使用 Play 2.3.4 和 Scala 2.11.5!有任何想法吗?

4

1 回答 1

2

好的,我想通了。我正在运行 Java 7,所以我必须使用以下内容作为我的依赖项:

"com.zaxxer" % "HikariCP-java6" % "2.3.7"

根据 HirakiCP 的文档,可在此处找到:

https://github.com/brettwooldridge/HikariCP

于 2015-05-19T16:15:56.343 回答