The Verification Code cannot be displayed, and an exception occurs on the server: cocould not initialize class sun. AWT. x11graphicsenvironment

Source: Internet
Author: User

Exception information:

Caused by: Java. Lang. noclassdeffounderror: cocould not initialize class sun. AWT. x11graphicsenvironment

Caused by: Java. Lang. internalerror: Can't connect to X11 window server using 'localhost: 10.0 'as the value of the display variable.


Website verification codes are essential! In fact, I am using Java SWT classes or methods. It works normally in the Windows system development, but it needs to be deployed to the Linux operating system, especially the X11 without a graphical interface installed, there will be no support. Obviously, hardware cannot support graphics. What we need is that the client (Windows or Linux with X11) can be displayed. The solution is to add the Catalina. Sh file under the bin directory of Tomcat installation directory:

-Djava. AWT. Headless = true \


Similar to this:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/48/1F/wKioL1QFpgnSse_rAAOydVdY6fE134.jpg "Title =" qq201409021920.3.jpg "alt =" wkiol1qfpgnsse_raaoydvdy6fe134.jpg "/>

My tomcat version is 7.0.45, And I have added 8 or 9 places!



Reference: http://my.oschina.net/xiangtao/blog/28441













This article from the "Long Road, very short" blog, please be sure to keep this source http://10000001.blog.51cto.com/4600383/1548003

The Verification Code cannot be displayed, and an exception occurs on the server: cocould 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.