我正在尝试构建一个桌面LibGDX项目,但是一直遇到这个错误。当我尝试在Intellij中打开它时,它不能正确同步。之前我在使用Gradle时遇到了一些问题,但在更新java之后,这个问题似乎已经解决了。
我使用的是jdk 14。
Generating app in C:\Users\John's Desktop\Desktop\test2
Executing 'C:\Users\John's Desktop\Desktop\test2/gradlew.bat clean --no-daemon'
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon:
https://docs.gradle.org/5.4.1/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
* 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 3s
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...发布于 2020-04-11 05:09:50
编辑:gradle/wrapper/gradle-wrapper.properties
将Gradle版本更改为较新的版本,如:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip您可能需要Java 14.0.0-zulu才能运行它,因为我尝试使用Java 14.0.0-open,它为我提供了:
/tmp/libgdxvushu/dd5c1a65/liblwjgl64.so:
java.lang.UnsatisfiedLinkError
发布于 2020-03-19 12:00:12
解决了!我没有意识到LibGDX创建了一个gradle项目,而gradle目前与java14不兼容,所以我降级到了java8,它可以工作。
发布于 2020-03-28 16:26:50
我遇到了同样的问题。
JDK12也能正常工作。
https://stackoverflow.com/questions/60748318
复制相似问题