Setting java.awt.headless=true programmatically
- by reto
I'm trying to set java.awt.headless=true during the application startup but it appears like I'm to late and the non-headless mode is already started:
static {
System.setProperty("java.awt.headless", "true");
/* java.awt.GraphicsEnvironment.isHeadless() returns false */
}
Is there another way set headless=true beside -Djava.awt.headless? I would prefer to not configure anything on the console.
Thanks!
Reto