PSA: Use Java 8 (Not 9 or 10).

Dan_Prime

Emissary
Guest
Currently Java 8 is the only supported version for launching the game.

Mojang's launchwrapper fails when using any version higher than Java 8. In addition, Forge itself does not support the latest versions. Expect this to be the case until 1.13 or later.

If you see the following error, you need to downgrade back to Java 8.

Code:
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)

The above issue originates in the Mojang LaunchWrapper, however it masks a larger error. Forge does not support Java 9 and there is no roadmap for when it will. For the forseeable future you will need Java 8 to connect to the server.

The following pull request would fix the issue with launchwrapper: https://github.com/Mojang/LegacyLauncher/pull/11
 
Last edited: