-
On the main menu, choose .
Tip
Alternatively, press Ctrl+Alt+OCommand Alt O or choose on the context menus of the Project tool window.
-
In the Optimize Imports dialog box, specify where you want IntelliJ IDEA to remove unused import statements from.
- To have unused imports removed from the current file, select the File option.
- To have unused imports removed from all files in the current directory, select the All files in directory... option.
- Click Run.

