How to Run a Pixelmon Server: Fixing Forge 1.12.2 Errors

47 views

If you’re like me, and you’ve tried to set up a Forge 1.12.2 server for Pixelmon, only to have it fail with an error, then this blog post is for you! In this article, I’ll be walking you through the steps I took to get my Forge server up and running. Hopefully this will help some of you out there who are struggling with the same issue.

A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34)
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)
… 6 more

 

I searched around for half an hour trying to find a fix for this that worked, but nothing has so far. I am pretty sure I already had java 8 installed when I first started having this issue, but just to be sure I found an old download for java 8 from around 2018 to see if that would work, and it still didnt. Im at a loss for what to do in this scenario, so I was hoping someone here could help.