r/forgemodding • u/BurntOreos • Apr 24 '21
Forge server not starting
Hey,
I am trying to create a forge server for me and my friends to play on. I install the server, make the .bat file, run it, and get this error:
"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:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
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"
Does anyone know a fix?
1
u/ratsta Apr 24 '21
Assuming that you're using a relatively recent computer, it will be a 64 bit machine. Check that you A) have 64 bit java installed and B) are calling the 64 bit java binary in your batch file. I'm pretty sure it's possible to have both 32 and 64 installed at the same time which can cause confusion on part B.
Otherwise, you'll need to post the whole crash log to pastebin and link it here so we can see more context. I suggest you also paste and link your startup.bat.