Http://hi.baidu.com/ppt2000/blog/item/07e75960b6d43ad88cb10d3e.html
Early in the morning to the company, found that JSP verification code can not be displayed. Check tomcat log: "Could not initialize Class Sun.awt.X11GraphicsEnvironment". Online Search, in catalina.sh add a sentence "catalina_opts=-djava.awt.headless=true", problem solving.
It is generally found that the user who started Tomcat was unable to access Xserver, including the Xserver did not start or did not have access. Plus.
The following is a repost:
1. What is headless mode?
Headless mode is a configuration mode of the system. In this mode, the system is missing a display device, keyboard, or mouse.
2. When to use and headless mode?
Headless mode is not what we would like to see, but in fact we often need to work in this mode, especially the server-side program developers. Because servers (such as hosts that provide Web services) tend to lack the aforementioned devices, they also need to use the features they provide to generate the appropriate data to provide to the client (such as the browser's host with the associated display device, keyboard, and mouse).
3. How do I use and headless mode?
Generally in the program starts to activate headless mode, tell the program, now you want to work in headless mode, do not expect the hardware to help, you have to self-reliance, rely on the system's computational ability to simulate these features to:
System.setproperty ("Java.awt.headless", "true");
Both
Hello,
Sometimes we get the error message:
Could not initialize class sun.awt.X11GraphicsEnvironment ....
We have eliminate the cause with a entry in the startup of the JVM.
java_opts= '-xms256m-xmx512m-d java.awt.headless=true '
Unset DISPLAY
Greetings
Kathrin Schwarz
Could not initialize class Sun.awt.X11GraphicsEnvironment