architectury / architectury-loom

A Gradle plugin to setup environments for Fabric, Forge, NeoForge and Quilt modding.
https://docs.architectury.dev/loom/introduction
MIT License
110 stars 37 forks source link

Failed to start Forge after 1.20.3 in IDEA #191

Open qyl27 opened 8 months ago

qyl27 commented 8 months ago

Repo: SinoCraftProject/SinoSeries

Reproduce:

  1. Clone repo with commit bbf99ac.
  2. Run Minecraft Forge Server (:sinoseries-meta:sinoseries-meta-forge).

Log:

[Architectury Transformer] Architectury Runtime 5.2.80
[Architectury Transformer] Read classpath in 3.653 s
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at net.minecraftforge.bootstrap.Bootstrap.start(Bootstrap.java:48)
    at net.minecraftforge.bootstrap.ForgeBootstrap.main(ForgeBootstrap.java:18)
    at juuxel.unionrelauncher.UnionRelauncher.main(UnionRelauncher.java:92)
    at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
    at dev.architectury.transformer.TransformerRuntime.main(TransformerRuntime.java:219)
Caused by: java.lang.module.FindException: Module org.lwjgl.tinyfd not found, required by org.lwjgl.tinyfd.natives
    at java.base/java.lang.module.Resolver.findFail(Resolver.java:893)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:192)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:141)
    at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:492)
    at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:298)
    at net.minecraftforge.bootstrap@2.0.0/net.minecraftforge.bootstrap.Bootstrap.moduleMain(Bootstrap.java:77)
    ... 9 more
qyl27 commented 8 months ago

After my test, it seemed to be a problem that occurred on forge 1.20.3+.

qyl27 commented 7 months ago

A similar issue in another project with forge 1.20.3-49.0.2.
Both client and server.
qyl27/NBTEdit

MarbleGateKeeper commented 6 months ago

Same issue. 1.20.4 forge.

Yeregorix commented 5 months ago

I had a similar issue with Forge 1.20.4 but for server only. Somehow arch-loom is adding LWGJL natives but not LWGJL itself. I managed to fix the issue by adding the following code to my buildscript.

afterEvaluate {
    tasks.runServer {
        classpath = classpath.filter { !it.toString().contains("\\org.lwjgl\\") }
    }
}

I'm completely removing LWJGL because it is not needed on the server anyway. This is not a clean fix but it works for me.

Fuzss commented 4 months ago

This now also affects the Forge runClient task. Using Minecraft Forge 50.0.0 for Minecraft 1.20.6 on ArchLoom 1.6-SNAPSHOT. The workaround posted above does not work for me. Fabric and NeoForge don't have any issue. Here is the exception:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at net.minecraftforge.bootstrap.Bootstrap.bootstrapMain(Bootstrap.java:133)
    at net.minecraftforge.bootstrap.Bootstrap.start(Bootstrap.java:53)
    at net.minecraftforge.bootstrap.ForgeBootstrap.main(ForgeBootstrap.java:19)
    at juuxel.unionrelauncher.UnionRelauncher.main(UnionRelauncher.java:92)
    at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
    at dev.architectury.transformer.TransformerRuntime.main(TransformerRuntime.java:219)
Caused by: java.lang.module.FindException: Module jopt.simple not found, required by cpw.mods.modlauncher
    at java.base/java.lang.module.Resolver.findFail(Resolver.java:892)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:192)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:141)
    at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:491)
    at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:297)
    at net.minecraftforge.bootstrap@2.1.0/net.minecraftforge.bootstrap.Bootstrap.moduleMain(Bootstrap.java:166)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    ... 7 more

Also runServer is still broken:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at net.minecraftforge.bootstrap.Bootstrap.bootstrapMain(Bootstrap.java:133)
    at net.minecraftforge.bootstrap.Bootstrap.start(Bootstrap.java:53)
    at net.minecraftforge.bootstrap.ForgeBootstrap.main(ForgeBootstrap.java:19)
    at juuxel.unionrelauncher.UnionRelauncher.main(UnionRelauncher.java:92)
    at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
    at dev.architectury.transformer.TransformerRuntime.main(TransformerRuntime.java:219)
Caused by: java.lang.module.FindException: Module org.lwjgl.openal not found, required by org.lwjgl.openal.natives
    at java.base/java.lang.module.Resolver.findFail(Resolver.java:892)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:192)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:141)
    at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:491)
    at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:297)
    at net.minecraftforge.bootstrap@2.1.0/net.minecraftforge.bootstrap.Bootstrap.moduleMain(Bootstrap.java:166)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    ... 7 more