Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solution to the problem of garbled code display in Tomcat command window under Windows

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

I. description of the problem

The configuration of the Tomcat just downloaded from the official website has not changed. The Tomcat window is launched to display garbled codes in Chinese.

Second, try the method

1. Modify the server.xml file in the conf directory in the Tomcat directory

New: URIEncoding= "UTF-8"

As shown in the picture

2. Modify the catalina.bat file in the bin directory in the Tomcat directory

What's new:

Set JAVA_OPIS=-Xms512m-Xms1024m-XX:MaxPermSize=1024m-Dfile.encoding=UTF-8

As shown in the figure:

Result: the problem still exists.

3. Modify the logging.properties file in the conf directory in the Tomcat directory

Change the final java.util.logging.ConsoleHandler.encoding = UTF-8 to java.util.logging.ConsoleHandler.encoding = GBK, and the other parameters remain unchanged or UTF-8 will not affect the startup garbled.

Or

Add something to the last line:

Java.util.logging.ConsoleHandler.encoding = GBK

As shown in the figure:

Or directly modify and change the following utf-8 in the file tomcat/conf/logging.properties to GBK and save it:

1catalina.org.apache.juli.FileHandler.encoding = UTF-82localhost.org.apache.juli.FileHandler.encoding = UTF-83manager.org.apache.juli.FileHandler.encoding = UTF-84host-manager.org.apache.juli.FileHandler.encoding = UTF-8java.util.logging.ConsoleHandler.encoding = GBK

Result: problem solved

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report