libGDX 项目生成器显示“构建失败”每次我尝试生成项目时

问题描述 投票:0回答:1

我正在尝试使用 libGDX 项目安装程序在我的计算机上安装 libGDX,并将位置设置为所需的一切。但是每次我单击“生成”时,都会收到此错误:

Generating app in C:\Users\lenovo\Desktop\test
Executing 'C:\Users\lenovo\Desktop\test/gradlew.bat clean --no-daemon'
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\lenovo\Desktop\test\settings.gradle' (C:\Users\lenovo\.gradle\caches\7.5.1\scripts\2e5ewf69m4vwrhf5dztt0u5q6).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

* 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

BUILD FAILED in 6s
Done!
To import in Eclipse: File -> Import -> Gradle -> Existing Gradle Project
To import to Intellij IDEA: File -> Open -> build.gradle
To import to NetBeans: File -> Open Project...
Generating app in C:\Users\lenovo\Desktop\test
Executing 'C:\Users\lenovo\Desktop\test/gradlew.bat clean --no-daemon'
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\lenovo\Desktop\test\settings.gradle' (C:\Users\lenovo\.gradle\caches\7.5.1\scripts\2e5ewf69m4vwrhf5dztt0u5q6).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

* 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

BUILD FAILED in 5s
Done!
To import in Eclipse: File -> Import -> Gradle -> Existing Gradle Project
To import to Intellij IDEA: File -> Open -> build.gradle
To import to NetBeans: File -> Open Project...
Generating app in C:\Users\lenovo\Desktop\test
Executing 'C:\Users\lenovo\Desktop\test/gradlew.bat clean --no-daemon'
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\lenovo\Desktop\test\settings.gradle' (C:\Users\lenovo\.gradle\caches\7.5.1\scripts\2e5ewf69m4vwrhf5dztt0u5q6).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

* 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

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

我尝试到处搜索,但很难让它发挥作用。我对此很陌生,非常感谢任何帮助。

java gradle libgdx game-engine game-development
1个回答
0
投票

错误出现在“不支持的类文件主要版本 63”中。

Java 类文件版本 63,是 java jdk 19,因此它抱怨类文件已针对 java 版本 19 编译,但您使用的版本比版本 19 更小。

© www.soinside.com 2019 - 2024. All rights reserved.