Linux Java program in Chinese garbled solution __linux

Source: Internet
Author: User

In a Linux system, Java programs may have problems with the Chinese language, and the solution is to do the following 2 actions

1, install the font

Copy Chinese font files, such as Simhei.ttf, to the jre/lib/fonts directory

The following two commands are then executed in the fonts directory to rebuild the font index:

Mkfontscale

Mkfontdir

2, let Java support the font

Look for these two files in the Jre/lib directory: Fontconfig. REDHAT.6.BFC and FONTCONFIG.REDHAT.6.PROPERTIES.SRC

Make a copy of these 2 files, named (Fedora System): Fontconfig. REDHAT.17.BFC and FONTCONFIG.REDHAT.17.PROPERTIES.SRC

Other systems, etc.


In this way, the application should be able to display Chinese correctly.

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.