Java 8 will not function only with 1.12.2 servers?

OS Name/Version: Ubuntu 22.04.1 LTS

Product Name/Version: 2.4.0.10

Problem Description: I have found that my servers running forge 1.16.5 using Java 8 (Open JDK) work perfectly fine however if i try to run any forge 1.12.2 versions i get the


A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:110)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:62)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:31)
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 3 more

Which as I understand is the generic “I have the wrong java” error. But I dont understand why this is occurring when it evidently works elsewhere.

I have tried to install forge 1.12.2 manually, i have tried different releases but all give the same error when installed.

To prove java is on the system -
image

Did you already try to reselect Java 8?

Yeah I have tried swapping but to no avail

Try running with the TEMURIN 8 that is the Adoptium versions AMP now installs by default. That one is working on my current 1.12.2 Planetary pack.

Also check the Support tab for that instance and the Last Executable line make sure it shows the Java 8 you have selected.

1 Like

Ahh ha that’s pointed me in the right direction, seems it’s still selecting Java 18,
image
Thanks for the pointer, annoying me how easy that was to see and yet I didn’t.

Will try doing it manually then and see how it goes, just not entirely sure how to do this via AMP

That Java dropdown is the right place just try using the TEMURIN 8 instead. once you click anywhere else it will show it saved the settings. Make sure the game is stopped or the instance will not pick up the new java settings.

1 Like