An error occurred while generating images in jfreechart in Linux (Java. Lang. noclassdeffounderror sun. AWT. x11graphicsenvironment)

Source: Internet
Author: User

By default, the image display function is not enabled for Tomcat/resin in Linux. You need to add support options.
 
In Linux, when we use Java image packages to process images, we often encounter Java. lang. noclassdeffounderror: Sun. AWT. x11graphicsenvironment, because the Java Virtual Machine needs local X-server support for image processing, there are two solutions:
 
1 Java 1.4 or later
 
Add the parameter-djava. AWT. Headless = true when starting Java. For example, add this parameter to the startup command line when starting tomcat.
 
For websphere, enter the applicationProgramServer> server1> process definition> Java Virtual Machine
 
General JVM independent variables:-dfile. Encoding = GBK-ddefault. Client. Encoding = GBK-djava. AWT. Headless = true
 
2. Versions earlier than Java 1.4
 
Download Xvfb or other Virtual X-Windows, and then change the display in the Java Runtime Environment.

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.