Jump to content

[SOLVED] Trouble Running Forge Server


Recommended Posts

Hello,
I'm trying to use the forge installer to install a modded server on my computer. I've tried about 5 separate times now (each time in a different folder) to install the server yet it crashes each time I try to run it. The unmodded vanilla server .jar file downloaded through the installer runs just fine, however trying to run the forge server .jar (with or without my batch file) produces the following error:

Spoiler

C:\Users\DIRECTORYSTUCTURE\>java -Xmx1024M -Xms1024M -jar forge-1.12.2-14.23.1.2555-universal.jar
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(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:62)
        at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:31)
Caused by: java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
        at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        ... 6 more

C:\Users\DIRECTORYSTRUCTURE\>pause
Press any key to continue . . .

The contents of the batch file I'm trying to use are as follows:

Spoiler

java -Xmx1024M -Xms1024M -jar forge-1.12.2-14.23.1.2555-universal.jar
pause

Any idea what's up? Thanks.

 

EDIT: Forge installer version is 1.12.2-14.23.1.2555

Edited by impromptutriplet
Link to comment
Share on other sites

1 hour ago, impromptutriplet said:

Caused by: java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader

 

You're using Java 9, which isn't supported by Forge. You need to use Java 8 instead.

  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

6 hours ago, Choonster said:

 

You're using Java 9, which isn't supported by Forge. You need to use Java 8 instead.

That fixed it! For anyone else having this problem you don't need to uninstall Java 9, if you have 9 and 8 installed you can specify which version of Java to run by entering the full directory in your batch file like so:

Spoiler

"C:\Program Files\Java\jre1.8.0_151\bin\java" -Xmx1024M -Xms1024M -jar forge-1.12.2-14.23.1.2555-universal.jar
pause

Note the quotes around the directory, they're necessary if there are any spaces (like in the folder "Program Files").

 

Thanks for the help!

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.

Guest
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.