IDEA控制台输出中文乱码的解决方案

二、解决方法:

1.打开tomcat配置页面,Edit Configurations。

 

2.选择项目部署的tomcat,在配置项VM options文本框中输入-Dfile.encoding=UTF-8,点击Apply或OK即可。

 

3.尝试重启tomcat,乱码问题解决。

 

ps:若乱码问题依然存在,请尝试继续按以下步骤解决:

1.打开IntelliJ IDEA本地安装目录中bin文件夹下的idea.exe.vmoptions和idea64.exe.vmoptions这两个文件。

 

2.分别在这两个文件内容的末尾添加-Dfile.encoding=UTF-8

 

 

3.打开IntelliJ IDEA>File>Setting>Editor>File Encodings,将Global Encoding、Project Encoding、Default encodeing for properties files这三项都设置成UTF-8,点击OK或者Apply。

 

4.重启IntelliJ IDEA即可解决乱码问题。

若控制台输出的中文为机器文字 我们需要修改tomcat的conf文件下的配置

如下图 将utf-8 改成GBK

IDEA控制台输出中文乱码的解决方案

相关文章:

  • 2022-12-23
  • 2021-12-16
  • 2021-08-11
  • 2021-08-08
  • 2021-10-28
  • 2021-05-24
  • 2021-06-22
  • 2022-01-02
猜你喜欢
  • 2021-08-31
  • 2021-04-18
  • 2022-12-23
  • 2021-08-25
  • 2021-07-05
  • 2022-01-01
  • 2021-09-13
相关资源
相似解决方案