设置步骤
修改tomcat日志文件logging.properties
java.util.logging.ConsoleHandler.encoding = UTF-8修改IDEA配置文件idea.exe.vmoptions和idea64.exe.vmoptions,
IDEA → Help → Edit Custom VM Options,文件末尾加上
-Dfile.encoding=UTF-8Tomcat catalina.bat文件中搜索"JAVA_OPTS",在最后一个
set "JAVA_OPTS"后面添加
set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8"
或者
IDEA tomcat设置那边
VM options添加参数-Dfile.encoding=UTF-8IDEA → Settings 搜索Encoding,把相关的编码改为UTF-8
IDEA → Settings → Editor → File Encodings,所有选项改为UTF-8
IDEA → Settings → Editor → General → Console,DefaultEncoding改为UTF-8