解决IDEA启动Tomcat控制台中文乱码

一、配置系统编码为UTF-8

一次点击File—>Settings —> Editor —> File Encoding

1.将Global EncodingProject Encoding的编码格式切换为UTF-8

2.将Properties Files下的Default encoding for properties files的编码格式切换为UTF-8,并将其后的 选择框勾选上 。

二、编辑VM

  1. 点击 Help --> Custom VM Options

  2. 在底部添加 -Dfile.encoding=UTF-8

三、配置Tomcat

3.1配置server

  1. 点击运行按钮Run左边的Edit Configurations,选择Tomcat中的Server

VM options中添加 -Dfile.encoding=UTF-8

3.2配置Startup/Connection

在上一步的界面中,切换到右边的Startup/Connection

  • 在环境变量Environment Variables中添加键值对:
JAVA_TOOL_OPTIONS
-Dfile.encoding=UTF-8

————END————
原文地址:https://www.cnblogs.com/langkye/p/13140478.html