Chinese font garbled characters in Java in Linux

Source: Internet
Author: User
Tags tomcat
Old Jiang was a friend of mine who helped write a project in JAVA, because he had never been familiar with such environments before, and now JSP hosts are hard to find (virtual hosts have not been used for a long time ), so a few days ago, we set up a JAVA website environment in Linux VPS (here we install the JSP environment ). Then we moved the project into the project this evening. Everything went smoothly, but we found that the Chinese characters on the verification code were garbled.

 

After checking the information, we can see that there should be no fonts installed. There are various methods on the Internet, but this method is relatively simple. Because after JDK1.5, you only need Jre/lib/fonts/Create FallbackDirectory. Simsun. ttcIf the font is lost, restart the server.

 

1. Log on to the corresponding directory

 

The code is as follows: Copy code

/Usr/java/jdk1.7.0 _ 80/jre/lib/fonts/

 

Here, Chiang is the JDK1.7 version installed, so we can find it.

 

2. Create the fallback Directory

 

You can use mkdir to create one, or you can use FTP to manually create one.

 

Third, Upload Simsun. ttcFont

 

The code is as follows: Copy code

Http://soft.itbulu.com/fonts/simsun.zip

 

We can download the font and decompress it Simsun. ttcUpload FallbackDirectory.

 

Finally, restart tomcat

 

You can restart tomcat or reboot the server. This takes effect.

 

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.