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
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
wrong java version
This error happens many times in the Minecraft community lol
@kuak14 what Minecraft version are you on?
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
run java -version
in cmd
java 20 wont work
https://www.java.com/en/download/help/uninstall_java.html all of em and get java 8 or 11
I had a different problem with java 8 update 381 before that.
now a java 11 experience
well java 20 wont work in general
for 1.12.2
with java 11
now a different error
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
@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
i didnt read
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
:wsl:
Windows subsystem for Linux?
yes
wsl is great
Woaa
sudo update-alternatives --config java
That's the magic command
And you choose a java ver
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 use the java.exe
Not javaw.exe
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
Better to use java.exe
No problem
thanks man
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
I am at 2:43 am
I ran 1.16.5 with java 11
Cool then
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?
dont use hamachi
Port forward
okey
ok i will try
Hamachi bad