方法一:windows-->Preferences(windows版本,mac:eclispe-->perference),左侧,输入save 搜索, 直接找到Save Actions,勾选“Perform the selected actions on save”;
方法二:windows-->Preferences-->Java --> Editor-->Save Actions, 看到右边的选项了吧,勾选“Perform the selected actions on save”;