Reputation: 53
I am using the following environment variable for tomcat configuration,
JAVA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx512M -XX:MaxPermSize=256M"
Here I didn't understand what is the meaning of -D
and headless
, although it's not mandatory I am still curious to know: what does it mean?
Upvotes: 3
Views: 8793
Reputation: 122018
TDS Reference: Summary of JAVA_OPTS (Dead link. Cached here and here.)
An obscure bug concerning X servers and graphics rendering code can cause WMS requests to fail or, in certain situations, cause Tomcat to crash. You may see error messages like the following:
"java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment"
To avoid this situation, the graphics code needs to be told that there is no graphics console available. This can be done by setting the java.awt.headless system property to true which can be done using JAVA_OPTS:
JAVA_OPTS="-Xmx1024m -Xms256m -server -Djava.awt.headless=true" export JAVA_OPT
Upvotes: 3
Reputation: 68715
Headless mode is a system configuration in which the display device, keyboard, or mouse is lacking. Sounds unexpected, but actually you can perform different operations in this mode, even with graphic data.
Where it is applicable? Let's say that your application repeatedly generates a certain image, for example, a graphical authorization code that must be changed every time a user logs in to the system. When creating an image, your application needs neither the display nor the keyboard. Let's assume now that you have a mainframe or dedicated server on your project that has no display device, keyboard, or mouse. The ideal decision is to use this environment's substantial computing power for the visual as well as the nonvisual features. An image that was generated in the headless mode system then can be passed to the headful system for further rendering.
Source and to read furher: http://www.oracle.com/technetwork/articles/javase/headless-136834.html
Upvotes: 2