gpt4 book ai didi

java - LibGDX 创建项目失败

转载 作者:行者123 更新时间:2023-12-02 10:07:13 32 4
gpt4 key购买 nike

我无法使用 gdx-setup.jar 创建新的 libgdx 项目。当我检查高级> eclipse以在eclipse中使用它时,它告诉我构建失败。它告诉我以下内容:

Generating app in D:\programmierung\libgdx\test
Executing 'D:\programmierung\libgdx\test/gradlew.bat clean --no-daemon eclipse afterEclipseImport'
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.6/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
:core:clean
:desktop:clean UP-TO-DATE
:html:clean UP-TO-DATE
:eclipseProject
:eclipse
:core:eclipseClasspath
:core:eclipseJdt
:core:eclipseProject
:core:eclipse
:desktop:eclipseClasspath
:desktop:eclipseJdt
:desktop:eclipseProject
:desktop:eclipse
:html:eclipseClasspath
:html:eclipseJdt
:html:eclipseProject
:html:eclipseWtpComponent
:html:eclipseWtpFacet
:html:eclipseWtp
:html:generateGdt UP-TO-DATE
:core:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':core:compileJava'.
> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_201 contains a valid JDK installation.

* 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 12s
18 actionable tasks: 15 executed, 3 up-to-date
Done!
To import in Eclipse: File -> Import -> General -> Existing Projects into Workspace
To import to Intellij IDEA: File -> Open -> YourProject.ipr

我该如何解决这个问题?

最佳答案

该问题不是由错误的 libgdx 安装引起的。

Please check that C:\Program Files\Java\jre1.8.0_201 contains a valid JDK installation.

确保您的 JAVA_HOME 指向 JDK 而不是 JRE。

此外,最好您的 JDK 与每个子模块(核心、桌面、android、ios...)中的 build.gradle 中声明的版本相同。您应该找到与此类似的条目:

sourceCompatibility = '1.8'

因此请相应地选择您的 JDK。

关于java - LibGDX 创建项目失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55265766/

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