Window-> Preferences-> Java-> Code Style-> Formatter: Edit Active profile-> Indentation-> Tab Policy: select spaces
You cannot change the default profiles, so you must specify a new profile name, then click the "Apply" button, then the "OK" button. This may help to click the Apply button as soon as you return to the Formatter screen. Go back and look at the tab policy again to make sure your changes are saved.
source share