'Could not initialize class sun.awt.image.IntegerInterleavedRaster' when Resizing an Image

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

Symptoms

Image resizing, as described in Displaying a Thumbnail Imagedoes not work. The following appears in the atlassian-confluence.log:

1 2 3 4 5 6 7 java.lang.NoClassDefFoundError: Could not initialize class sun.awt.image.IntegerInterleavedRaster at java.awt.image.Raster.createPackedRaster(Raster.java:782) at java.awt.image.Raster.createPackedRaster(Raster.java:466) at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015) at java.awt.image.BufferedImage.<init>(BufferedImage.java:312) at com.atlassian.core.util.thumbnail.SimpleImageConsumer.createImage(SimpleImageConsumer.java:180) at com.atlassian.core.util.thumbnail.SimpleImageConsumer.setColorModel(SimpleImageConsumer.java:42)

Cause

The missing class sun.awt.image.IntegerInterleavedRaster is included in <JDK installation folder>\jre\lib\rt.jar. If you do not have this jar file you may see the error above.

Resolution

Reinstall Java or make sure that your JAVA_HOME is pointing at the right directory.

ℹ️ This also occurs when you don't specify -Djava.awt.headless=true when running on Linux flavoured OS.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.