Forge server not starting

Yes that was what I meant about editing java. When I do cd /jdk8u312-b07/bin it lets me into the directory. I can then use

ls -l java

-rwxrwxrwx 1 root root 8640 Mar 9 00:52 java

That shows that it is read write and execute for everyone if I am correct.

However when I run /jdk8u312-b07/bin/java -jar forge-1.16.5-36.2.20-installer.jar or run the same with the regular forge jar that I manually placed in there I get Error: Unable to access jarfile forge-1.16.5-36.2.20-installer.jar

Wait actually I just typed out the absolute path to the .jar file and it spit out this instead.

JVM info: Temurin - 1.8.0_312 - 25.312-b07
java.net.preferIPv4Stack=true
Found java version 1.8.0_312
Exception in thread "main"
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
        at java.awt.Window.<init>(Window.java:536)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1763)
        at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1838)
        at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1696)
        at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:666)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:637)
        at net.minecraftforge.installer.SimpleInstaller.launchGui(SimpleInstaller.java:177)
        at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:147)

I suppose it is using the correct java so that is great but it seems like something is still going wrong since I cannot start it via the WebUI.

From what I know of JDK and JRE should I be using JRE instead, I am pretty sure JDK can do everything that the JRE can but when it brings up headlessexception I don’t know if that has anything to do with the JRE.

Sorry I should have tested a few more things before responding because now I am responding a lot. So I ran it again with the absolute path but with the .jar instead of the installer.jar because I noticed that it was trying to launch the launcher gui and that was throwing it off maybe because my server doesn’t have a monitor. So when I ran the regular forge jar it ran correctly (I think) a lot of green lines of text appeared but the last line said, you need to agree to the EULA before it will run, I already have the EULA set to true so I am not sure why it isn’t working.

I got it to work!!! I just got back home and decided to delete the old server I had been messing with and create a new one going through all the steps to see if that would work and it did! I created the new server and before accepting the EULA or clicking start I went in and set java_binary to the correct path. After I did that the server started once I accepted the EULA. I made sure the mod list matched the client mod list and it let me join the server. It seems like everything is working now. Though it is a little arrogant saying that I got it work because I did not, it was all you ElPres. Thanks for all the help! I definitely would not have figured it out on my own so if it were not for your help I would probably just have given it up after a few weeks.

1 Like

It makes it much easier to help when you’re willing to put in some work of your own to research and try.
In many cases I’ll download things and test stuff out to provide my answers.

Thanks for also being a part of the solution.