Java version problems

java.awt.HeadlessException: No X11 DISPLAY variable was set

What the log looks like

java\.awt\.HeadlessException:
No X11 DISPLAY variable was set,[\r\n\s]+or no headful library support was found

How to fix it

  1. If you are on a Linux desktop, install the full non-headless OpenJDK package for your distribution (for example, 'sudo dnf install java-21-openjdk' on Fedora, 'sudo apt install openjdk-21-jre' on Debian/Ubuntu, or 'sudo pacman -S jdk21-openjdk' on Arch) rather than the '-headless' package.
  2. Ensure your system defaults to the full Java runtime by checking 'java -version' or switching the active runtime with 'sudo update-alternatives --config java' (or 'archlinux-java' on Arch).
  3. If you are running a dedicated Minecraft server over SSH or in a container, add 'nogui' to the end of your server launch command so it runs strictly in the terminal.
  4. If a headless Quilt server throws this error inside 'org.quiltmc.loader.impl.gui.QuiltUI', update Quilt Loader to 0.26.1 or newer so GUI popups for unsupported mod files do not halt the server.
  5. If you use a Wayland desktop on Linux and the full JDK is already installed, verify that XWayland is installed and running so Java X11 windows have a valid DISPLAY variable.
LoadersForge, Neoforge, Fabric, Quilt, Vanilla, Server
SeverityStops the game
CategoryJava version problems

Check your own log

Related errors