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

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

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

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

二、编辑VM

  1. 点击 Help --> Custom VM Options

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

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

三、配置Tomcat

3.1配置server

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

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

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

3.2配置Startup/Connection

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

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

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

————END————

相关文章:

  • 2021-05-05
  • 2021-09-29
  • 2021-09-08
  • 2021-07-23
  • 2022-12-23
  • 2021-07-20
  • 2021-11-29
  • 2021-11-21
猜你喜欢
  • 2021-11-10
  • 2021-06-21
  • 2021-09-23
  • 2021-11-06
  • 2021-09-19
  • 2021-04-03
相关资源
相似解决方案