LibGdx项目设置-用gradle错误生成的项目

时间:2018-09-26 03:11:35

标签: java libgdx

我正在尝试使用gdx-setup.jar工具生成基于LibGdx的项目

我遇到了一些以前从未遇到过的奇怪错误。您能协助我成功生成项目吗?

  

在C:\ Games \ Jewel Games中生成应用程序New       执行'C:\ Games \ Jewel Games New / gradlew.bat clean --no-daemon'       为了遵守此构建的JVM设置,将分叉新的JVM。请考虑使用守护程序:   https://docs.gradle.org/4.6/userguide/gradle_daemon.html。       守护进程将在处理后在构建结束时停止

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Games\Jewel Games New\build.gradle' line: 57

* What went wrong:
A problem occurred evaluating root project 'Jewel Games New'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version
     

52.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 16s
Done!
To import in Eclipse: File -> Import -> Gradle -> Gradle Project
To import to Intellij IDEA: File -> Open -> build.gradle
To import to NetBeans: File -> Open Project...

1 个答案:

答案 0 :(得分:1)

  

java.lang.UnsupportedClassVersionError:com / android / build / gradle / AppPlugin:不支持的major.minor版本52.0

major.minor version 52.0错误可能是因为jar是在JDK 1.8中编译的,但是您正在尝试使用JDK 1.7环境运行它。

要解决此问题,最好让JDK和JRE指向相同的版本。