0

最近,我一直想回到 Minecraft 改装,所以我选择了 Fabric 进行改装。我查看了教程页面,专门用于为 Fabric 创建和生成源代码。但是,在运行gradlew eclipse命令时,Gradle 会吐出错误消息,说我使用的是 Java 的过时版本,Java 8,但需要 Java 16 或更高版本。但我正在使用 Java 16,它在我的JAVA_HOME路径中。

这是完整的错误:

D:\fabricmcmodding118iguess\moreores>gradlew eclipse
Picked up _JAVA_OPTIONS:
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.3.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.

* Where:
Build file 'D:\fabricmcmodding118iguess\moreores\build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'fabric-loom', version: '0.10-SNAPSHOT']
> Failed to apply plugin 'fabric-loom'.
   > You are using an outdated version of Java (8). Java 16 or higher is required.
     The JAVA_HOME environment variable is currently set to (C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\).

* 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 9s

在提出问题之前我已经进行了研究,人们只是说“更新 gradle”或“更新 JDK/JRE”,但我的都更新了,如下所示:

java -version
Picked up _JAVA_OPTIONS:
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12)
OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)
gradlew -version
Picked up _JAVA_OPTIONS:

------------------------------------------------------------
Gradle 7.3.1
------------------------------------------------------------

人们还说要禁用守护程序,或者有时在他们等待时,Gradle 会再次修复自己,但是,org.gradle.daemon=false命令并--no-daemon在说gradlew eclipse. 另外,我正在尝试 Forge 的示例并且 Gradle 工作正常,那么我该如何解决这个问题呢?

4

0 回答 0