当我尝试使用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!有什么想法吗?
答案 0 :(得分:2)
好的,我想出来了。我正在运行Java 7,所以我不得不使用以下内容作为我的依赖项:
"com.zaxxer" % "HikariCP-java6" % "2.3.7"
根据HirakiCP的文档,可在此处找到: