gpt4 book ai didi

java - 使用 play-scalr 会引发不支持的 Major.minor 版本 51.0

转载 作者:行者123 更新时间:2023-12-01 04:45:04 25 4
gpt4 key购买 nike

我正在尝试使用 play-scalr与 Play,并按照 Github page 上的安装说明进行操作,但是当我请求调整大小的图像时,我收到错误:

[RuntimeException: java.lang.UnsupportedClassVersionError: se/digiplant/scalr/api/Resizer$Mode : Unsupported major.minor version 51.0]

当我编译该项目时,下载了 jar,因此我认为问题是它们是使用 Java 1.7 编译的,但我尝试将它们与 Java 1.6 一起使用:

$ play compile
[info] Loading project definition from /Users/brad/projects/builders/project
[info] Set current project to builders (in build file:/Users/brad/projects/builders/)
[info] Updating {file:/Users/brad/projects/builders/}builders...
[info] downloading http://repo1.maven.org/maven2/se/digiplant/play-scalr_2.10/1.0/play-scalr_2.10-1.0.jar ...
[info] [SUCCESSFUL ] se.digiplant#play-scalr_2.10;1.0!play-scalr_2.10.jar (2782ms)
[info] downloading http://repo1.maven.org/maven2/se/digiplant/play-res_2.10/1.0/play-res_2.10-1.0.jar ...
[info] [SUCCESSFUL ] se.digiplant#play-res_2.10;1.0!play-res_2.10.jar (2553ms)
[info] Done updating.
[success] Total time: 26 s, completed 14/04/2013 3:06:18 PM

这是我正在使用的版本:

$ play about
[info] Loading project definition from /Users/brad/projects/builders/project
[info] Set current project to builders (in build file:/Users/brad/projects/builders/)
[info] This is sbt 0.12.2
[info] The current project is {file:/Users/brad/projects/builders/}builders
[info] The current project is built against Scala 2.10.0
[info] Available Plugins: play.Project, sbt.PlayProject, com.typesafe.sbteclipse.plugin.EclipsePlugin, com.typesafe.sbtidea.SbtIdeaPlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.9.2

$ scala -version
Scala code runner version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL

$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)

$ javac -version
javac 1.6.0_43

最佳答案

我最终下载了 play-scalr 的源代码,使用 Java 1.6 进行编译,然后将生成的 .jar 放入我的 lib/目录。

关于java - 使用 play-scalr 会引发不支持的 Major.minor 版本 51.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15995958/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com