1、打开eclipse 偏好设置:command + ,
2、General ——>Content Types——>Text——>Java SourceFile
3、将编码设置为GBK
看图

1、打开eclipse 偏好设置:command + ,
2、General ——>Content Types——>Text——>Java SourceFile
3、将编码设置为GBK