Biomancy

Biomancy

3M Downloads

ForgeGradle can't deobfuscate Java 21

ByThePowerOfScience opened this issue ยท 1 comments

commented

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?

commented

Very odd bug. The jar is build with Java 17 (Temurin) and the gradle java toolchain is set to 17 as well.

Have you checked that your Gradle JVM is using Java 17?