Setting java.awt.headless=true programmatically

Posted by reto on Stack Overflow See other posts from Stack Overflow or by reto
Published on 2010-03-31T11:17:03Z Indexed on 2010/03/31 11:23 UTC
Read the original article Hit count: 485

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about java

Related posts about headless