So I was running a minecraft server under java8 jre/jdk and it just worked fine. I had to install a newer version of jre/jdk because of university (IntelliJ IDEA). I tried to start the minecraft server because i wanted to play with my friends and it says:
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 cpw.mods.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:48)
at cpw.mods.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:17)
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.(Launch.java:33)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
⌠6 more
The output of archlinux-java status is (i removed java 8 because i tought that i dont need it anymore):
Available Java environments:
java-15-openjdk (default)
And the output of java -version is:
openjdk version â15.0.2â 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7)
OpenJDK 64-Bit Server VM (build 15.0.2+7, mixed mode)
I would appreciate if some of you could help me.