Java 7 only
Seems Java 7 needs headless
Java 7 only
Fixed warning