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.
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.
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.
To remove those unused imports automatically, just click on the class and press the shortcut “Ctrl + Shift + O” to initilize the “Organize imports” feature.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With