出于某种原因,这个问题与 gradle 和 yarn 有关,无论我如何尝试让“fabric-loom”插件正常工作,都没有任何效果。它说我使用的是 Java 的过时版本,我使用的是 Java 11(我不是,我在 bash 终端中使用了“java -version”),我使用的是 Mac,顺便说一句,它说我是在 Java 16.0.2(它告诉我要使用的版本)上,我将附上日志和我编写的一些代码。如果有人可以帮助我,那就太好了,在此先感谢:)
崩溃日志:
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'. Build file '/Users/joeplemople/Desktop/joes blocks/build.gradle' line: 2 An exception occurred applying plugin request [id: 'fabric-loom', version: '0.9-SNAPSHOT'] Failed to apply plugin 'fabric-loom'. You are using an outdated version of Java (11). Java 16 or higher is required.
(由于某种原因,这被输出了两次,我知道为什么)
终端代码(Bash):
- 显示我安装了 JoepleMoples-MacBook-Pro 的 java 版本:
joes blocks joeplemople$ /usr/libexec/java_home -V Matching Java Virtual Machines (2): 16.0.2, x86_64: "Java SE 16.0.2" /Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home 11.0.12, x86_64: "Java SE 11.0.12" /Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home
- 我将 Java 的默认版本设置为 Java (JDK) 16:
/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home JoepleMoples-MacBook-Pro:joes blocks joeplemople$ export JAVA_HOME=$(/usr/libexec/java_home -v 16.0.2) JoepleMoples-MacBook-Pro:joes blocks joeplemople$ java -version java version "16.0.2" 2021-07-20 Java(TM) SE Runtime Environment (build 16.0.2+7-67) Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
提前致谢 :)