1、设置File--> Settings--> Editor--> Flie Encodings中的编码
2、打开help中的Edit Custom VM Options...文件,
3、在Edit Custom VM Options...文件最后增加一行-Dfile.encoding=utf-8,保存后重启IDEA。这一步操作后,tomcat打印的启动日志及系统日志的中文就不再乱码了,但我的项目的数据库报的异常,中文依然乱码。
4、点击Edit Configurations打开tomcat配置页面。
5、在VM options:中添加-Dfile.encoding=UTF-8,保存后,重启服务,数据库打印的日志中文没有再出现乱码。