Jump to content

error when creating modded server


Recommended Posts

i followed this tutorial here to create a forge 1.12.2 server, but i can't get the server to start/mod folder to appear.

the following error comes up when i click the run.bat: 

C:\Users\onlin\OneDrive\Desktop\forge server>java -Xmx2048M -Xms2048M -jar forge.jar nogui
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

i checked comments and people were saying you can't have multiple java versions installed, but people were also saying you can get it to choose which java version.

so i tried editing the run.bat again with the path to the java 8

"C:\Users\onlin\Downloads\jre-8u351-windows-x64.exe" -Xmx2048M -Xms2048M -jar forge.jar nogui

but when i run it i keep getting this error from java:

"Unable to install java

There are errors in the following switches:


Check that the commands are valid and try again."

how can i fix this without uninstalling my other java versions? and also make the mod folder appear.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.