Could not initialize class Sun.awt.X11GraphicsEnvironment

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.