自动格式化 windows–>Preferences–>Java --> Editor–>Save Actions,勾选“Perform the selected actions on save” Ctrl + s,保存即可自动格式化