1.打开tomcat配置页面,Edit Configurations。
2.选择项目部署的tomcat,在配置项VM options文本框中输入-Dfile.encoding=UTF-8,点击Apply或OK即可。
若乱码问题依然存在,请尝试继续按以下步骤解决:
1.打开IntelliJ IDEA本地安装目录中bin文件夹下的idea.exe.vmoptions和idea64.exe.vmoptions这两个文件。
分别在这两个文件内容的末尾添加-Dfile.encoding=UTF-8
2.打开IntelliJ IDEA>File>Setting>Editor>File Encodings,将Global Encoding、Project Encoding、Default encodeing for properties files这三项都设置成UTF-8,点击OK或者Apply。
上述两种方法还是没有用则试试最后一种:
最后一招就是在Intellij Idea的Help中HELP->Edit Custom VM OPtions中加-Dfile.encoding=UTF-8