Pages or Spaces Fail to Load Due to Failure Initializing sun.awt.X11GraphicsEnvironment Class

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Symptoms

There are several ways this error could occur, from a theme failing to individual images not appear on a page. Errors with stack traces including the following line will be found in the logs.

1 Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

Diagnosis

Run a tail of the atlassian-confluence.log file and reproduce the situation you are facing. If you see the above line in the resulting stack trace then you are affected by this issue

Cause

Confluence is running on a headless server but the JVM is not set as running on a headless server

Solution

Resolution

⚠️ These changes require a restart of Confluence to take affect

Add the following argument to your java start options for Confluence, if you are not sure how to change these settings please have a look at our Configuring System Properties documentation

1 -Djava.awt.headless=true
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.