彻底解决Idea控制台的中文乱码问题
一.出现问题
tomcat输入到idea控制台的信息出现中文乱码。

二.解决方案
1.打开idea安装的目录,bin文件夹下,找到idea.exe.vmoptions和idea64.exe.vmoptions两个文件,打开。


2.将-Dfile.encoding=UTF-8写到最后一行。


3.打开idea的 File->Setting -> Editor-> File Encoding,三个位置选择都选择UTF-8,apply然后ok。


4.选择Run->Edit Confgurations
,将配置的Tomcat的VM options项中添加-Dfile.encoding=UTF-8。


5.打开Run->Edit Configurations将Tomcat下的Startup/Connection选项卡中的run/debug中的Pass environment variables的JAVA_OPTS的value设成-Dfile.encoding=UTF-8。


6.重启idea,运行项目查看效果。

网友评论