Jdk1.4 and jdk1.5 are displayed in Chinese in linux.

Source: Internet
Author: User
In linux, jdk1.4 and jdk1.5 display configurations in Chinese-Linux general technology-Linux programming and kernel information. For details, see the following. Jdk1.4:
In linux, swing in java cannot display Chinese characters by default. There are many introductions on the Internet, but they do not seem to be very detailed. Therefore, I think it is necessary to repeat these conventions.

First, use the su command to switch to root, and then use the cd command to switch to your jdk installation path. For example, on my machine, install jdk under/usr/java/j2sdk1.4.2 _ 01.

Switch to the jre/lib directory under the Directory and back up font. properties:

# Cd/usr/java/j2sdk1.4.2 _ 01/# cd jre/lib/# mv font. properties font. properties. bak

Next, copy font. properties. zh_cn.sun to font. properties. If your machine does not have font. properties. zh_cn.sun, there should be "font. properties. zh_cn. Other words" or something. If none of them exist, you 'd better reinstall an updated version of jdk.

# Cp font. properties. zh_cn.sun font. properties

Finally, edit the copied font. properties file, jump to the end of the file, find "filename. xxx = ". Change the path to simsun on your machine. the full path of ttf. The appendedfontpath line below also changes accordingly, pointing the path to your simsun. the folder where ttf is located.

Filename. -hanyi-hanyisong-medium-r-normal -- *-% d-*-c-*-gbk-0 =/usr/share/fonts/local/simsun. ttfappendedfontpath =/usr/share/fonts/local/

Jdk1.5
In linux, swing in java cannot display Chinese characters by default. Many Chinese configurations of jdk 1.4 are introduced on the Internet, and this is also introduced on the webpage of dianhu. In contrast, it is hard to find the relevant information about jdk 1.5's Chinese configuration. It takes a lot of effort to configure the Chinese display of jdk 1.5. The configuration process is described as follows:

First, use the su command to switch to root, and then use the cd command to switch to your jdk installation path. For example, on my machine, install jdk under/usr/java/jdk1.5.0 _ 05.

Switch to the jre/lib directory under this directory, and you will see many files under this directory, such as fontconfig. *. properties. src. Select a properties closest to your system and copy it to fontconfig. properties. For example, my system is fedora core, so I use fontconfig. redhat. properties:

# Cp fontconfig. redhat. properties. src fontconfig. properties

Edit the copied font. properties file and change the default Chinese font in the component font mappings block at the beginning of the file to simsun, as shown below:

# Component font mappingsallfonts. chinese-cn-iso10646 =-misc-simsun-medium-r-normal -- *-% d-*-c-*-iso10646-1

Then, add the simsun path ing in the font file names block and change the following path to the path of simsun. ttf on your machine:

# Font file namesfilename. -misc-simsun-medium-r-normal -- *-% d-*-c-*-iso10646-1 =/usr/local/share/fonts/simsun. ttf

Finally, jump to the end of the file and point the awt font search path to the corresponding directory:

# Awt x11 font pathsawtfontpath. chinese-tw-iso10646 =/usr/local/share/fontsawtfontpath. chinese-cn-iso10646 =/usr/local/share/fontsawtfontpath. japanese-iso10646 =/usr/local/share/fontsawtfontpath. korean-iso10646 =/usr/local/share/fonts
Related Article

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.