window
1、Window > Preference > Text Editors : 勾选Insert spaces for tabs ,如果要在删除时也同时删除4个,就勾选remove multiple spaces on backspace/delete ,然后apply
2、Window > Preferences > Java > Code Style > Formatter, 点击New,命名4tab确认后,修改Indentation > Tab policy 为 Spaces only,然后apply
3、如果要显示空格:Window > Preference > Text Editors ,勾选Show whitespace characters
Mac
1、Eclipse > Preference > Text Editors : 勾选Insert spaces for tabs ,如果要在删除时也同时删除4个,就勾选remove multiple spaces on backspace/delete ,然后apply
2、Eclipse > Preferences > Java > Code Style > Formatter, 点击New,命名4tab确认后,修改Indentation > Tab policy 为 Spaces only,然后apply
3、如果要显示空格:Eclipse > Preference > Text Editors ,勾选Show whitespace characters