我正在使用以下环境变量进行Tomcat配置:
JAVA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx512M -XX:MaxPermSize=256M"
在这里,我不理解-D
和headless
的含义,虽然它们并非必须的,但我仍然很想知道:它们是什么意思?
我正在使用以下环境变量进行Tomcat配置:
JAVA_OPTS="-server -Djava.awt.headless=true -Xms384M -Xmx512M -XX:MaxPermSize=256M"
在这里,我不理解-D
和headless
的含义,虽然它们并非必须的,但我仍然很想知道:它们是什么意思?
TDS参考: JAVA_OPTS概述 (链接失效。在这里和这里有缓存版本.)
该链接为TDS的JAVA_OPTS概述,但是该链接已经失效。您可以在这里或者这里查看缓存版本。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