Remove all unused imports in one go using Eclipse IDE | Community
Skip to main content
RashidJorvee
Level 4
July 23, 2020

Remove all unused imports in one go using Eclipse IDE

  • July 23, 2020
  • 1 reply
  • 8632 views
Many times we face problem where some unwanted imports get added in the our program file. It is very annoying and time consuming task to remove those unused imports one by one, to make our code clear and readable.
But we do have a shortcut for this, just in a millisecond our Eclipse IDE done this job for us. Eclipse provide a shortcut CTRL + SHIFT + O, this shortcut command will remove all those unused imports from your code file.
 
To do so, click anywhere in your java file and press CTRL+SHIFT+O. After using this shortcut command Eclipse will remove all the unused import from your java file. Below are the screenshots:

Before:

 

After:

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

kautuk_sahni
Community Manager
Community Manager
August 11, 2020

Thank you for sharing this wonderful article. @rashidjorvee , Please keep on sharing such phenomenal articles with AEM Community here.

Kautuk Sahni