PDA

View Full Version : Headless Operation


admin
15-07-2008, 20:22
For safe headless operation of Java application servers I use two options:

-Djava.awt.headless=true
unset DISPLAY


The first option, "-Djava.awt.headless=true" is a Java system property. It is relatively well-known.

The shell command "unset DISPLAY" is not very well known. It removes any references to remote X11 displays, including ones that have been forwarded over ssh connections. This solves issues where application servers stop working as soon as you log off. :-)

Hope this helps.

In the past, what problems (and solutions) did you have with headless operation?

Kees Jan

Tobias
23-07-2008, 20:23
I wonder why the JDK does not automatically fallback to headless is there is no window system available. How is throwing an exception better?

kjkoster
23-07-2008, 20:57
Just thinking out-loud here: perhaps it is because graphics tend to be display-dependent in things as colour maps and colour depth. Perhaps throwing the exception makes more sense than making assumptions (to the JDK devs ;) ).