GlowstoneMC/Glowstone — pull request #587 by Unkn0wn0ne (2014-12-07 18:02:26+00:00)
Title: Fixed console check on headless environments

Addresses #586

What this does is re-enables and patches the console check to work on environments that are not headless (meaning they have a display, keyboard, or mouse) and if they support the Desktop AWT apis.
This allows the application to run on headless servers but blocks people double clicking on windows the jar file.

This was tested on a Windows 8.1 (x64) machine running the latest Java 8 update (oracle JVM), with and without the -Djava.awt.headless=true flag.