JDK-7124417 : [macosx] failure in Window.initGC on Mac with monitor sleeping
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: os_x
  • CPU: generic
  • Submitted: 2011-12-23
  • Updated: 2014-07-29
  • Resolved: 2012-03-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u20Fixed 9Fixed
http://java.net/jira/browse/MACOSX_PORT-134 submitted 2011/07/01 by Yuri Nesterenko
If System preferences for the Energy Saver is set to Display sleep == certain value which is not Never, and if that timeout reached, then Java programs starting after this moment bomb in Window.initGC() presumably having null default screen device.            
gc = GraphicsEnvironment.getLocalGraphicsEnvironment().
Actual situation like this is a long Swing test run: if a test fails with timeout, most subsequent tests fail in Window.initGC().
Now, I don't know if it is possible to fix this in the program. Is there a way on Mac to provide a default Screen device without a monitor attached?

EVALUATION Author: Mike Swingler Date: 01/Jul/11 03:30 PM If memory serves, display power sleeping can turn off the graphics hardware, so I think we just have to live with not having a screen surface available. You can also make the screen sleep on demand with the Ctrl-Shift-Eject keystroke.