找了一圈,终于找到解决方法了 code runner的扩展设置 java选项改成 cd $dir && javac -encoding utf-8 $fileName && java $fileNameWithoutExt