Jfreechart does not display in Linux and Chinese garbled problem

Source: Internet
Author: User

The use of Jfreechart-built reports, under window can be normal display, but put on Linux under the error, and sometimes the Tomcat hung off,

The reason for this is that Jfreechart needs to access the graphical capabilities provided by the Java AWT Library in Linux, and most versions of the Java AWT Class library under Linux require some of the features provided by X server. And the system that basically makes the server does not start X server (even not install at all).

The error is as follows:

X connection to localhost:11.0 broken (explicit kill or server shutdown).

My workaround is as follows: The following files are found in the Linux directory:

Vi/etc/profile

At the end add: Export catalina_opts= '-djava.awt.headless=true '

Two. Chinese garbled problem

User figures, funds accounted for the use of jfreechart developed images, Chinese display as garbled

Cause of the problem:
The Jdk6 (JRE) on Linux does not natively support Chinese.

Problem solving:
1) C:\WINDOWS\FONTS\simsun.ttc the font under XP (that is, Arial, size 10M) and rename it to Simsun.ttf.
2) Copy Simsun.ttf font to/usr/share/fonts/zh_cn/truetype/
3) execute under the Linux command line:
fc-cache/usr/share/fonts/zh_cn/truetype/font installation is complete, you can use this font.

Jfreechart does not display in Linux and Chinese garbled problem

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.