Getting A sun.java2d.HeadlessGraphicsEnvironment cannot be cast to sun.awt.Win32GraphicsEnvironment Error on Startup
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
The following error is logged on startup:
1
2
3
4
5
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: sun.java2d.HeadlessGraphicsEnvironment cannot be cast to sun.awt.Win32GraphicsEnvironment
at sun.awt.windows.WToolkit$4.run(WToolkit.java:735)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
:
Cause
This is caused by a Sun JVM bug. (Fixed in all currently supported versions)
Resolution
While the error message can be safely ignored, the problem can be fixed by removing this JVM parameter from <Fisheye installation>/bin/fisheyectl.bat
:
1
-Djava.awt.headless=true
Follow these steps:
Edit
bin/fisheyectl.bat
. Change the following line from:1
%_EXECCMD% %FISHEYE_OPTS% "-Dfisheye.library.path=%FISHEYE_LIBRARY_PATH%" "-Dfisheye.inst=%FISHEYE_INST%" -Djava.awt.headless=true "-Djava.endorsed.dirs=%FISHEYE_HOME%\lib\endorsed" -jar "%FISHEYE_HOME%\fisheyeboot.jar" %* %FISHEYE_ARGS%
To:
1
%_EXECCMD% %FISHEYE_OPTS% "-Dfisheye.library.path=%FISHEYE_LIBRARY_PATH%" "-Dfisheye.inst=%FISHEYE_INST%" "-Djava.endorsed.dirs=%FISHEYE_HOME%\lib\endorsed" -jar "%FISHEYE_HOME%\fisheyeboot.jar" %* %FISHEYE_ARGS%
Restart Fisheye.
Was this helpful?