I follow Java 1.9. it contains many interesting Features (JDK 9)
But I worried about the Classloader changes: JEP 238: Multi-Release JAR Files (mixin, asset, …)
I would like to know if I can use Java 1.9 (after Release) with Sponge…
Java is backwards compatible. A Java program written for Java 1.0 will run just fine on a Java 9 JVM. So long as you don’t use any Java 9-specific features, then your program will be compatible with other Java 8 programs, including Sponge, on any JVM that both will run on.
Ok~, but I will use Java 1.9 Features in my Plugins
Or with other words, I use 1.9 JDK and I work consciously with 1.9 Features (Other Projects)
Now I switch to Sponge and I miss Features from 1.9 → Can I wait for Java 9 support or I have to work with workarounds
Well, which Java 9 features do you intend to use, and how will the Java 9 JDK improve your plugins?
And you must also keep in mind that not many people will have Java 9 installed, meaning that all of your plugins compiled for Java 9 will be incompatible with their JVMs.
Using the jigsaw module system will definetely not work with sponge/forge/minecraft due to class loading changes. However, the module system is optional - you can still create a program using java 9 api and run that with the same command as you would have used in java 8, and it will work. So there is no reason not to use java 9 api features, just keep in mind that you can’t use modules (and why would you, honestly? the module system is kinda useless)
Just saying, number 269 is useful if you’re not using Guava, but Sponge does, which has useful methods like ImmutableList.of() or ImmutableMap.of() or whatever.
Mainly, due to the overhaul of how class loaders work under project jigsaw, Minecraft itself will need to be updated for Java 9, after which, the entire toolchain for Forge/Sponge, etc. will have to be updated.
Put it this way, you can’t even run Gradle on Java 9 at the moment, due to the huge changes in modularity of the JVM. And with that, if Sponge moves forward to Java 9, that wouldn’t necessarily break smaller plugins, it would certainly require plugins make the move to Java 9’s module system and update plugin dependencies etc.
I think I heard somewhere that AppClassLoader no longer extends URLClassLoader in Java 9, that alone with break many applications that assume the ACL is a URLClassLoader.