-
在工具栏上找到window,点击 window->preference
然后在打开的界面中选择 General->Editors->Text Editors,
再选中右侧的 insert space for tabs
-
再点击 window->preference-
依次选择 java(或C++)->code style ->formatter,
选择右侧的editor,再选择左侧 tab policy的值为spaces only,确定
-
若出现Apply按钮为灰色的情况,需要回到上一步,点击new按钮,根据当前的样式重新生成新的样式并进行保存,重复第2步,编辑该样式即可