解决Idea中Gradle构建控制台乱码、输出文件内容乱码

build.gradle配置文件中增加

tasks.withType(JavaCompile){
    options.encoding='UTF-8'
}

点击Idea中Help->Edit Custom VM Options,增加(修改后需要关掉所有Idea进程再重开才生效)

-Dfile.encoding=COMPAT
posted @ 2024-06-20 10:20  ExcellentDavid  阅读(534)  评论(0)    收藏  举报