Hi, I'm trying to run my server and every time I use my start file I get this problem:
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:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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)
... 6 more
logout
My start file has this code currently (though I've used a heap of other code, theres a reason I use this):
#!/bin/bash
cd "$(dirname "$0")"
exec java -Xms1024M -Xmx4096M -jar /*(fileroute expunged for privacy)*/forge-1.10.2-12.18.3.2511-universal.jar nogui
If I manually open the forge jar it runs fine, but it doesn't have enough Ram.
I used to run the same files on another computer and everything worked fine as well.
Similarly, I've spent an hour going around this new computer messing with it and it is definitely using Java 8, which is what most people say about this problem.
Can someone please tell me how stupid I am? I would really appreciate it.