Closed
Issue #42 · created by Selebrator · ·

Java 9 instant ClassCastException

I'm trying to run
LiteLoader 1.12.2-SNAPSHOT-r4CC2BB0-b4-4 with
Java 9.0.1 64-Bit using the JVM Arguments:
-Xmx1G -XX:+UseConcMarkSweepGC -XX:-UseAdaptiveSizePolicy -Xmn128M (like default but without -XX:+CMSIncrementalMode because that is not allowed anymore in Java 9).
Vanilla Minecraft runs without any problems and even better than with Java 8.
With LiteLoader installed the game doesn't start and the console output is

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Exception in thread "main" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
    at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

It crashes so early that no log file is created.
I didn't use any other mods but LiteLoader and experience no problems when running LiteLoader with Java 8.

Because Java 9 has been released since 2017-09-21, I think this issue should be adressed in the near future.
I'm aware of many difficultys with Java 9 for the Minecraft community but people will move on eventually.

2 participants
liteloader/LiteLoader#42