Java version problemsjava.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
- 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.
- 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).
- 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.
- 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.
- 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.
| Loaders | Forge, Neoforge, Fabric, Quilt, Vanilla, Server |
|---|
| Severity | Stops the game |
|---|
| Category | Java version problems |
|---|
Check your own log