nea89o / Forge1.8.9Template

The Unlicense
141 stars 42 forks source link

runClient task fails #5

Closed x123development closed 2 years ago

x123development commented 2 years ago

As stated in the title, when trying to execute the "loom>runClient" task everything compiles successfully and is successfully assembled into a jar, but upon launching the task fails with the following error:

Task :runClient FAILED 4 actionable tasks: 3 executed, 1 up-to-date Exception in thread "main" java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') at net.minecraft.launchwrapper.Launch.(Launch.java:34) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)

FAILURE: Build failed with an exception.

BUILD FAILED in 13s 3:37:30 PM: Execution finished 'runClient'.

I am using IntelliJ and have set the Gradle jdk to 17 and the project jdk to 1.8 as stated in the readme. It seems, that the task tries to open Minecraft using the jdk 17 despite requiring jdk 1.8 to run. That is what I have found out, based on the Exception.

Running the mod with a fresh forge installation via the Minecraft launcher works fine. It's only the "runClient" task having issues.

I've attached the gradle config and build files as .txt here, in case that is important.

settings.gradle.kts.txt gradle.properties.txt build.gradle.kts.txt

nea89o commented 2 years ago

The runClient task currently does not work with loom in general in older versions. Please use the genIntellijRuns task to generate a run configuration and run this configuration.

x123development commented 2 years ago

Thanks for the clarification. Works like a charm!