Organize Imports Automatically

前端 未结 4 2030
花落未央
花落未央 2020-12-04 21:14

When using Eclipse, I find myself typing Ctrl+Shift+O several times, to organize imports (usually imports which are no longer required, generating warnings).

Is ther

4条回答
  •  感动是毒
    2020-12-04 21:20

    Preferences->Java->Editor->Save Actions->Configure...

    You can configure the removal of unused imports when saving from the Unnecessary Code tab.

    Adding imports would normally be done as you are writing the code otherwise it won't compile.

    This is how it looks like: enter image description here

提交回复
热议问题