Chinese problem solving in Java, Installanywhere on redhat

zhaozj2021-02-16  30

In multiple versions of Sun JDK / JRE, Chinese support on Redhat has always been very bad. For the default installation (do not modify any configuration files), the Chinese Chinese characters are always not available in the Java code (not using setFont). This happens to Windows and Solaris.

There is a saying that Sun and redhat are some kind of competitive relationship. For Sun, as long as Java can run on Solaris and Windows, other operating systems are redundant; as long as Java runs better in Windows, it is better than running on Windows. Windows is also redundant. It is this hostile attitude that makes Java in use when using non-Solaris operating systems, or it is extremely ugly.

Regardless of whether this statement is true, Sun does not solve the Chinese issue of Java in Redhat, bringing a lot of inconvenience to many Java programmers. There are also many people on Sun's own websites asking this question, but few have a good solution to make people regret.

For a while, I used installanywhere to make the installer running on the RedHat, the Chinese installation interface is always a block block. I tried all the Java VM on the Installanywhere website. I still can't do it. I will basically INSTALLANYWHERE website basics. All look at it, or I can't find a solution, so I simply doubting my IQ. So we are determined to investigate the Chinese issue of Java on RedHat.

I first asked the Chinese agent of Installanywhere asked this question, he supported a support, just said that installnywhere must support the Chinese installer production on RedHat. After a number of calls, I probably understood, Sun doesn't want InstallAnywhere to have a good performance on Redhat, so installanywhere They can't open a solution on the website, he recommends us to use Solaris. I said that we can't use Solaris, and then there is no substantial progress.

I was searching for a few weeks in Google, Chinese Yahoo. However, there are some information. Later I went to the Redhat company website and found some information. Then I tried it several times and finally got it.

Standard JRE / JDK only with Redhat 6 font.properties, I can't use it on Redhat 7.3 and RedHat 8.0. We need to build a font.properties.zh.Redhat placed in the redhat's JRE / LIB directory. Open / USR / LIB / X11 / FONTS / TTF-ZH or / USR / Share / FONTS / ZH_CN / TRUETYPE below Font.dir, copy one of the Chinese characters, such as -Misc-zysong18030-medium-r- NORMAL - 0-0-0-0-C-0-ISO10646-1, changed to -Misc-zysong18030-media-r-normal - * -% D - * - * - C- * in accordance with Java font rules -ISO10646-1, copy the contents of Font.properties.en to Font.properties.zh.Redhat.

I use font -Misc-zysong18030-medium-r-normal - 0-0-0-0-C-0-ISO10646-1 because it can be used on RedHat 7.3 and RedHat 8.0.

Because JRE / JDK can't find Redhat's True Type font, in the file font.properties.zh.redhat finally joined appendedFontPath = / usr / lib / x11 / fonts / ttf-zhappendedFontPath = / usr / share / fonts / zh_cn / trueType

Replace all the font names into -Misc-zysong18030-media-r-normal - * -% d - * - * - c - * - ISO10646-1, replacement font.properties.zh.redhat as follows:

# @ (#) font.properties.zh.redhat.linux 1.4 02/06/10 ## Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. #

# Component Font Mappings # Serif.0 = -Misc-Zysong18030-Medium-R-NORMAL - * -% D - * - * - C - * - ISO10646-1

Serif.Istalic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Serif.Bold.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Serif.Bolditalic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Sansserif.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Sansserif.italic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Sansserif.Bold.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Sansserif.Bolditalic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

MONOSPACED.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Monospaced.italic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

MONOSPACED.BOLD.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Monospaced.bolditalic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Dialog.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Dialog.italic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Dialog.Bold.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Dialog.bolditalic.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Dialoginput.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - c - * - ISO10646-1DIALOGINPUT.ISONG18030 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Dialoginput.Bold.0 = -Misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

Dialoginput.bolditalic.0 = -Misc-zysong18030-medium-r-normal - * -% d - * - * - c - * - ISO10646-1 # miss.char = 274f

# Component Font Character EncoDings # fontcharset.serif.0 = sun.io.Chartobyteiso8859_1Fontcharset.serif.1 = sun.awt.motif.Chartobytex11GBK

Fontcharset.sansserif.0 = sun.io.Chartobyteiso8859_1Fontcharset.sansserif.1 = sun.awt.motif.Chartobytex11GBK

Fontcharset.monospaced.0 = sun.io.Chartobyteiso8859_1Fontcharset.Monospaced.1 = sun.awt.motif.Chartobytex11GBK

Fontcharset.dialog.0 = sun.io.Chartobyteiso8859_1Fontcharset.dialog.1 = sun.awt.motif.Chartobytex11GBK

Fontcharset.dialoginput.0 = sun.io.Chartobyteiso8859_1Fontcharset.dialoginput.1 = sun.awt.motif.Chartobytex11GBK

# Exclusion Ranges # #

# Xfontset information # fontset.serif.plain = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.serif.italic = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.serif.Bold = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.serif.bolditalic = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.sansserif.plain = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.sansserif.italic = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.sansserif.bold = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.sansserif.bolditalic = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Monospaced.Plain = / - misc-zysong18030-medium-r-normal - * -% D - * - * - c - * - ISO10646-1FontSet.Monospaced.italic = / - misc-zysong18030-medium-r- NORMAL - * -% D - * - * - C - * - ISO10646-1

FontSet.Monospaced.Bold = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Monospaced.boldital = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialog.italic = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialog.bold = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialog.boldital = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialog.plain = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialoginput.italic = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialoginput.Bold = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialoginput.bolditalic = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

FontSet.Dialoginput.plain = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

# fontset.default = / # - b & h-lucida-medium-r-normal-sans - * -% D - * - * - p - * - ISO10646-1, / # - tlc-song-medium-r-normal- - * -% D - * - * - C - * - GBK-0

FontSet.default = / - misc-zysong18030-medium-r-normal - * -% D - * - * - C - * - ISO10646-1

AppendedFontPath = / usr / lib / x11 / fonts / ttf-zhappendedfontpath = / usr / share / fonts / zh_cn / trueType

Use Installanywhere We Compile Setup Select "Other Java Platform" to compile into a Java's setup.jar file, write a batch / script file on the redhat, set classpath, contain setup.jar, batch / script file to use Java Install Start the installer.

This method is tested under RedHat 7.3 / 8.0.

For traditional Chinese in the redhat, create a font.properties.zh_tw.redhat file, change the font name to a traditional Chinese character name, add the right appendedFontPath at the end of the file, of course, don't forget in redhat It is tested below 7.3 and 8.0. Different version configuration methods for Linux are different. Mainly because people with talking components such as Linus Torvalds are only focused on Linux kernel development. If they make a slight plan for other respects, the difference between Linux's different versions is not as big as it is now. During the use of Java Linux, we deeply experienced the bitterness of "Write Once, Debug Everywhere".

转载请注明原文地址:https://www.9cbs.com/read-27944.html

New Post(0)