'Could not initialize class sun.awt.image.IntegerInterleavedRaster' when Resizing an Image
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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 Image does not work. The following appears in the atlassian-confluence.log
:
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.