Method 1: On Unix platforms. The printed Chinese characters are garbled characters. Which of the following are Chinese characters in the logs recorded using Log4j ?, This problem is annoying. Of course, with my luck, this problem will certainly happen. Now, record the solution as every application starts a Java Process, the startup method is java $ OPTS com. xxx. xxx. xxx (java-Ddefault. client. encoding = GBK-Dfile. encoding = GBK-Duser. language = Zh-jar load-data.jar) where the variable $ OPTS is the JVM startup parameter we want to set. Set the JVM character set here. The settings are as follows:-Ddefault. client. encoding = GBK-Dfile. encoding = GBK-Duser. language = Zh. After this is added, the garbled problem is basically fixed. If the problem persists, I cannot solve it. Log4j cannot use the preceding method to set Chinese garbled characters when logging to a file. The setting method is: Open the log4j. properties file and set the output character set in the file Appender. As follows: log4j. appender. buss. encoding = GBK Method 2: After www.2cto. comjdk15 ~ Create a fallback directory under/jre/lib/fonts/and bake the font you want to use in java into this directory. The following method is passed in fc6, assume that the user's jre path is/usr/java/jdk1.6.0 _ 03/jre/cd/usr/java/jdk1.6.0 _ 03/jre/lib/fontssudo mkdir fallback