Biomancy icon indicating copy to clipboard operation
Biomancy copied to clipboard

ForgeGradle can't deobfuscate Java 21

Open ByThePowerOfScience opened this issue 7 months ago • 1 comments

Biomancy version: 1.20.1-2.8.2.0

When trying to compile with Biomancy as a dependency, ForgeGradle gives this error:

Exception in thread "main" java.lang.IllegalArgumentException: Unsupported class file major version 65
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:199)
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:180)
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:166)
	at net.minecraftforge.installertools.SrgMcpRenamer.processClass(SrgMcpRenamer.java:181)
	at net.minecraftforge.installertools.SrgMcpRenamer.lambda$process$3(SrgMcpRenamer.java:120)
	at net.minecraftforge.installertools.SrgMcpRenamer.lambda$process$9(SrgMcpRenamer.java:156)
	at net.minecraftforge.installertools.SrgMcpRenamer.forEachZipEntry(SrgMcpRenamer.java:170)
	at net.minecraftforge.installertools.SrgMcpRenamer.process(SrgMcpRenamer.java:153)
	at net.minecraftforge.installertools.SrgMcpRenamer.processNestedJar(SrgMcpRenamer.java:215)
	at net.minecraftforge.installertools.SrgMcpRenamer.lambda$process$8(SrgMcpRenamer.java:133)
	at net.minecraftforge.installertools.SrgMcpRenamer.lambda$process$9(SrgMcpRenamer.java:156)
	at net.minecraftforge.installertools.SrgMcpRenamer.forEachZipEntry(SrgMcpRenamer.java:170)
	at net.minecraftforge.installertools.SrgMcpRenamer.process(SrgMcpRenamer.java:153)
	at net.minecraftforge.installertools.SrgMcpRenamer.process(SrgMcpRenamer.java:139)
	at net.minecraftforge.installertools.ConsoleTool.main(ConsoleTool.java:55)
Error getting artifact: curse.maven:biomancy-492939:5441244_mapped_parchment_2023.09.03-1.20.1:null@jar from  DeobfuscatingRepo

It looks like the version of ASM that ForgeGradle uses in fg.deobf() can't handle class files from Java 21. Could you please make sure you're compiling on a Java 17 JVM so people can deobfuscate the jar and run their addons in dev?

ByThePowerOfScience avatar Jul 12 '24 00:07 ByThePowerOfScience