Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove unused import from All projects in eclipse

Is there a way , a shortcut or any setting which removes unused import from all projects ? effectively from workspace?

I found following question which states about removing from single file. How to remove unused imports from Eclipse.

But I need from whole workspace?

P.S.: Let me know if there are in any case ,a plug ins available for performing same.

like image 856
Priyank Doshi Avatar asked Jan 08 '13 13:01

Priyank Doshi


People also ask

How do I remove unused imports from an entire project?

Key combination Ctrl+ Shift + O - will trigger the Organize Imports that will remove and add missing imports. It is for single file only. It can be applied to entire projects too, or you can right click on a project and select it from the 'Source' menu.

How do I fix all imports in Eclipse?

1. Go to the line of unused import, press Ctrl + 1, which is an Eclipse shortcut of a quick fix. This will show a drop-down menu to fix this error and one of them will be “remove unused imports.” It will remove that import statement from the Java file.

How do I remove unused imports from spring boot?

To remove those unused imports automatically, just click on the class and press the shortcut “Ctrl + Shift + O” to initilize the “Organize imports” feature.


1 Answers

Key combination Ctrl+ Shift + O - will trigger the Organize Imports that will remove and add missing imports.

To apply it on whole workspace you just have to select the project in the view Package Explorer and then use the key combination

like image 63
Damian Leszczyński - Vash Avatar answered Oct 15 '22 21:10

Damian Leszczyński - Vash