I have to remove unused imports in my project. Previously i was using eclipse but now i work on STS.
In STS "CTRL + SHIFT + o" is not working to remove unused imports.
Instead of resolving each unresolved references, you can press CTRL+SHIFT+O that is a short cut for organize imports in Spring STS or any eclipse based tool. If you are working on Mac like me then the shortcut is COMMAND+SHIFT+O.
Ctrl + D. Deletes current line in the editor. Command + Shift + O. Ctrl + Shift + O. Organize imports in the current java file.
Go to Window > Preferences > Java > Code Style > Organize Imports. Change the value of Number of imports need for .
Eclipse provide a shortcut CTRL + SHIFT + O, this shortcut command will remove all those unused imports from your code file.
This is a bug of the Spring IDE, I've had it myself in the past.
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