1、设置idea的工程编码为utf8

IDEA 中文乱码

2、执行main函数时控制台可能会乱码

设置编码为:encoding utf-8

IDEA 中文乱码

3、设置tomcat编码格式

设置为:-Dfile.encoding=UTF-8

configurations选择tomcat设置

IDEA 中文乱码

 

IDEA 中文乱码

4、设置idea编码

找到安装idea目录下的bin目录,在idea.exe.vmoptions和idea64.exe.vmoptions里加入 :-Dfile.encoding=UTF-8

IDEA 中文乱码

IDEA 中文乱码

所有设置完成之后重启idea,运行项目控制台的编码就不会乱码了

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-04-25
  • 2021-11-30
  • 2021-07-26
  • 2021-12-08
  • 2021-12-03
猜你喜欢
  • 2021-12-21
  • 2021-11-05
  • 2022-12-23
  • 2021-10-27
  • 2021-06-01
  • 2021-05-31
  • 2021-11-06
相关资源
相似解决方案