
Gradle build issue
I'm trying to open a Minecraft Mod project downloaded from official sources like fabric-example-mod or forge mdk. In both cases the gradle build will fail with different errors:
Fabric:
FAILURE: Build failed with an exception.
* What went wrong:
org.gradle.api.plugins.internal.DefaultDecoratedConvention
> org.gradle.api.plugins.internal.DefaultDecoratedConvention
* 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 from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 3s
Forge:
Cause: org/gradle/internal/enterprise/impl/GradleEnterprisePluginServices has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
In case of Forge all IntelliJ settings (project sdk, and gradle JVM) and JAVA_HOME are set to Java 17. There is not a single reference of Java 11.
The interesting part is, when building the project with command line it works just fine even the task "gradlew runClient" which proofs that project is working as expected. This seems like the issue is IntelliJ related and not gradle/minecraft.
I'm using IntelliJ 2021.2.1 Community. Maybe this is too old? but it still worked fine 1 year ago.
Has anyone experienced something like that before or knows how to fix it?
Thanks!