解决方案:在build.gradle脚本中添加如下类容即可 //编译JAVA文件时采用UTF-8 tasks.withType(JavaCompile) { options.encoding = "UTF-8" }