server

There was a problem running Server launcher.java.lang.reflect.InvocationTargetException at java.base/java.lang.reflect.Method.invoke at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:110) (Method.java:578) en net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70) en net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34) Cause: java. lang.ClassCastException: jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader, loader is in 'java.base module of 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 Press any key to continue. . . How to solve this?? Anyone pls help
36 Replies
Admincraft Meta
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by uchihasasuke3908#0
ProGamingDk
ProGamingDk2y ago
wrong java version
CtrlAltDelMe
CtrlAltDelMe2y ago
This error happens many times in the Minecraft community lol @kuak14 what Minecraft version are you on?
kuak14
kuak14OP2y ago
1.12.2 version When I did it on my sister's computer, there was no problem. on my computer it gives an error is my java version update 381 java 8 update 381 and java 20 jdk versiyon and java 8 update 51 java 8 update 51 I just deleted it and got the same again but my sister's computer opens with it
ProGamingDk
ProGamingDk2y ago
run java -version in cmd
kuak14
kuak14OP2y ago
No description
ProGamingDk
ProGamingDk2y ago
java 20 wont work https://www.java.com/en/download/help/uninstall_java.html all of em and get java 8 or 11
kuak14
kuak14OP2y ago
I had a different problem with java 8 update 381 before that. now a java 11 experience
ProGamingDk
ProGamingDk2y ago
well java 20 wont work in general for 1.12.2
kuak14
kuak14OP2y ago
No description
kuak14
kuak14OP2y ago
with java 11 now a different error
kuak14
kuak14OP2y ago
No description
kuak14
kuak14OP2y ago
i deleted java 20 only java 8 update 381 with java 11 11.0.20 there is on the computer even with this i got error
CtrlAltDelMe
CtrlAltDelMe2y ago
@kuak14 Windows will always try to use the most recent java version You have three ways of going around with this issue First way is deleting all versions of java except java 8 Second way is Linking the java executable to your startup script Where you browse the java installation files and search for the java executable and then you paste the route
ProGamingDk
ProGamingDk2y ago
i didnt read
CtrlAltDelMe
CtrlAltDelMe2y ago
So Instead of "java -xms120m -xmxwhatever" it would look like "path/to/javaversion/bin/java -blah -blah" Third way is telling windows what java version it should use by default In debian and many other Linux distros you can do that with literally two commands but on windows I think it gets a little messy
ProGamingDk
ProGamingDk2y ago
:wsl:
CtrlAltDelMe
CtrlAltDelMe2y ago
Windows subsystem for Linux?
ProGamingDk
ProGamingDk2y ago
yes wsl is great
CtrlAltDelMe
CtrlAltDelMe2y ago
Woaa sudo update-alternatives --config java That's the magic command And you choose a java ver
kuak14
kuak14OP2y ago
Thank you very much, who¡ssus? I did as you said, I created it, when I deleted the java text in the bat file and pasted the file path of java, it started working and my server was opened, thank you very much
kuak14
kuak14OP2y ago
No description
kuak14
kuak14OP2y ago
No description
ProGamingDk
ProGamingDk2y ago
😄
CtrlAltDelMe
CtrlAltDelMe2y ago
@kuak14 use the java.exe Not javaw.exe
kuak14
kuak14OP2y ago
I tried java.exe first, it didn't work, but then I tried javaw.exe and when it happened, I continued with it. lol now i tried it with java.exe and it worked with it wtf
CtrlAltDelMe
CtrlAltDelMe2y ago
Better to use java.exe No problem
kuak14
kuak14OP2y ago
thanks man
CtrlAltDelMe
CtrlAltDelMe2y ago
This is usually the way I like to start Minecraft servers without pterodactyl so I don't have to always change the default java variable Now help me on how do I tell my parents that I was woke at 1 am because I had to deal with an mc server file issue & player data lmao 😭 Forge 1.16.5 can run with java 11 btw, I've done it myself But there's no diff between java 8 and 11 in this case
kuak14
kuak14OP2y ago
I am at 2:43 am I ran 1.16.5 with java 11
CtrlAltDelMe
CtrlAltDelMe2y ago
Cool then
kuak14
kuak14OP2y ago
hello, I sent my server world to another friend, but when I enter that server, I can't enter the server from another computer with hamachi, how can I fix it?
ProGamingDk
ProGamingDk2y ago
dont use hamachi
Discount Milk
Discount Milk2y ago
Port forward
kuak14
kuak14OP2y ago
okey ok i will try
CtrlAltDelMe
CtrlAltDelMe2y ago
Hamachi bad

Did you find this page helpful?