[BUILDTOOLS-324] BuildTools isn't working with Java 9 ea (should be fixed when GM of J9 is out) Created: 13/May/17  Updated: 13/May/17  Resolved: 13/May/17

Status: Resolved
Project: BuildTools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Yannick Lamprecht Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: BuildTools, ClassLoader, error, java9

Attachments: Text File BuildTools.log.txt    

 Description   

It looks like a custom classLoader has to be written. The default systemClassLoader doesn't load the classes. Could be related with project Jicksaw which seems to get delayed to a later Java release. Glowstone has a commit that introduces a custom URLClassLoader compatible with Java 8+9.

https://github.com/GlowstoneMC/Glowstone/commit/354640b5a78f842317ededed9aa304cc5185a707

Final mapped jar: work/mapped.22de4839.jar does not exist, creating!
Exception in thread "main" java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:436)
at net.md_5.ss.repo.RuntimeRepo.getClass0(RuntimeRepo.java:25)
at net.md_5.ss.repo.ClassRepo.getClass(ClassRepo.java:22)
at net.md_5.ss.repo.AggregateRepo.getClass0(AggregateRepo.java:30)
at net.md_5.ss.repo.ClassRepo.getClass(ClassRepo.java:22)
at net.md_5.ss.model.ClassInfo$1.apply(ClassInfo.java:97)
at net.md_5.ss.model.ClassInfo$1.apply(ClassInfo.java:92)
at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at com.google.common.collect.Iterators$7.computeNext(Iterators.java:674)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at net.md_5.ss.remapper.EnhancedRemapper.findFieldDeclarer(EnhancedRemapper.java:45)
at net.md_5.ss.remapper.EnhancedRemapper.mapFieldName(EnhancedRemapper.java:127)
at net.md_5.ss.remapper.ClassRemapper.visitField(ClassRemapper.java:71)
at org.objectweb.asm.ClassReader.readField(ClassReader.java:768)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:689)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
at net.md_5.ss.model.ClassInfo.remap(ClassInfo.java:120)
at net.md_5.ss.SpecialSource.map(SpecialSource.java:96)
at net.md_5.ss.SpecialSource.main(SpecialSource.java:44)
Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [java, -jar, BuildData/bin/SpecialSource-2.jar, map, -i, work/minecraft_server.1.11.2.jar, -m, BuildData/mappings/bukkit-1.11.2-cl.csrg, -o, work/mapped.22de4839.jar-cl]
at org.spigotmc.builder.Builder.runProcess(Builder.java:561)
at org.spigotmc.builder.Builder.main(Builder.java:319)

 

 



 Comments   
Comment by Yannick Lamprecht [ 13/May/17 ]

Looks like this is related to SpecialSource and the asm ClassReader. 

Comment by md_5 [ 13/May/17 ]

Nothing to do with classloaders.
No currently released version of asm supports Java 9 class files, so fixing this is predicated on a Java 9 version of asm being released.

We also don't support Java 9, although Spigot 1.12 will run acceptably on it, as will 1.11 when not using native transport.

Comment by Yannick Lamprecht [ 13/May/17 ]

This prerelease fixes the bug with java 9. https://github.com/findbugsproject/findbugs/releases/tag/3.1.0_preview1

 

I replaced the ASM classes in specialsource2 with the one of the  the prerelease and it seems to work well.

I know that ASM is a library used to manipulate bytecode. patching Craftbukkit/Spigot into the minecraft-server. 

Generated at Tue Apr 24 10:47:47 UTC 2018 using JIRA 7.8.0#78000-sha1:4568b9d484113d74dfb6f152fb925b5fa1be2ef7.