Hello, I've got a problem with my forge server I have done everything correctly and I am getting an error saying "A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException" That's not the full error but I have no idea what's wrong can I please get some help?
Startup Code:
@echo off
title Forge Server
:main
java -Xms1G -Xmx2G -jar forge.jar
goto main
Full 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: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: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.(Launch.java:34)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
... 6 more
Okay, i went into my folder "C:\Program Files\Java\jre1.8.0_281\bin" but idk what im looking for there is javacpl and javaw and javaws which one do i use? there isnt a folder in the bin saying java so im guessing its in there
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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
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
Hello, I've got a problem with my forge server I have done everything correctly and I am getting an error saying "A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException" That's not the full error but I have no idea what's wrong can I please get some help?
Startup Code:
Full Error:
You need Java8 jre to run a server
Currently, you are using jdk
Remove it and install Java 8
https://www.java.com/en/download
But when i tried to run a paper server it sayed i needed jdk so how am i supposed to use both?
Edit: Also is there anywhere i can go on here i would be able to help others with?
Paper server should also run with jre
In your start script you also can use a specific java path
Instead of
java -Xmx4G -Xms4G -jar server.jar
use the path for "java" - something like:
"c:\program files\java\version\bin\java" -Xmx4G -Xms4G -jar server.jar
Hello, Thanks for the reply but if you want paper it says to download JDK but anyway thanks for helping i'll try this
Okay, i went into my folder "C:\Program Files\Java\jre1.8.0_281\bin" but idk what im looking for there is javacpl and javaw and javaws which one do i use? there isnt a folder in the bin saying java so im guessing its in there
Oh nevermind i got it to work thanks so much for helping me.. is there a way to stop replys on this since i got help?
i have the same proplem i thing.
here the log
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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
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
can you help me ore somewone else
what did you choose?