Im setting up a Forge Minecraft server which uses Java. When running the installation .jar file, it prompts me with an exception.
java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:231)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
at java.desktop/javax.swing.UIManager.getSystemLookAndFeelClassName(UIManager.java:661)
at net.minecraftforge.installer.SimpleInstaller.launchGui(SimpleInstaller.java:162)
at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:143)
I understand that I need to set an X11 window server environment variable (for reasons unknown to me). I have tried setting the environment variable to :0.0, :10.0, :1, :1.0 yet I'm till getting the same exceptions. I am running the file on a version 20.04.1 Ubuntu Server. Any help is much appreciated.
question from:
https://stackoverflow.com/questions/65921317/java-awt-awterror-cant-connect-to-x11-window-server-using-0-0-as-the-value 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…