1.打开 run -> edit configuration 修改vm options 为 -Dfile.encoding=UTF-8
如图 基本就可以了。
2.也可以修改默认配置。 我的idea路径 /Applications/IntelliJ IDEA.app/Contents/bin 。 修改 idea.vmoptions 在尾行追加" -Dfile.encoding=UTF-8 "