作者:梁梁庆新 | 来源:互联网 | 2023-09-08 10:36
1. 修改IDEA配置文件中的编码设置idea.exe.vmoptions和idea64.exe.vmoptions,分别打开两个文件,并且在两个文件的最后面添加-Dfile.encoding=UTF-8
![](https://img2.php1.cn/3cdc5/3984/807/738217f5299d52d5.png)
![](https://img2.php1.cn/3cdc5/3984/807/a0bfcfe64fdaab50.png)
2. 在IDEA的File->settings里搜索encoding将编码都设置为UTF-8
![](https://img2.php1.cn/3cdc5/3984/807/7b8791ae0d12de0a.png)
下面的这种是错的!!!之前我看见是System Default: UTF-8,以为就是UTF-8编码,结果一直乱码,所以一定要设置为UTF-8,而不是系统默认编码!
![](https://img2.php1.cn/3cdc5/3984/807/205ecca78abda4f0.png)
3. 重启生效