Eclipse is a wonderful and most powerful IDE to work with. If you have written a line of code and the imports for it is missing or say you have borrowed a piece of code and imports are missing, you do not need to manually remember or type the imports of the Classes being used, simple press "Ctrl + Shift + O" and all needed imports will be added to the class file.
By doing "Ctrl + Shift + O" you also remove any unwanted/unused imports that exist in your class file.
Example :
Let's say you copied a line "Data d = new Date();" and you see an error like
Multiple markers at this line
- Date cannot be resolved to a type
- Data cannot be resolved to a type
Press Ctrl + Shift + O you will get a pop-up dialog saying that Date class exists in two packages "com.sql.Date" and "com.util.Date" choose the appropriate and you would see that import statement is added just below package statement at the top. If imports have no resolution to do you would not get this popup and simply the imports will get added.

- How to display hidden files in Eclipse (dot prefixed files)
- Convert existing code project into a git project using Eclipse
- How to enable line numbers in Eclipse IDE
- [Eclipse] Syntax error, annotations are only available if source level is 1.5 or greater
- Enable Spellcheck in eclipse workspace
- How to create a Git Project in Eclipse (Step-by-step)
- [Solution] Spring Tool Suite (STS) support for JSP (JAVA EE)
- How to Remove All Terminated Console tabs at once in Eclipse
- Eclipse Java: Multiple markers at this line error
- Compare Current and Previous Versions of Same File (Local History) in Eclipse
- Eclipse : Workspace was written with an older version of the product and will be updated
- How to Save Eclipse console logs in external log file
- Fix: Eclipse Cant Connect to any repository not Authorized Error GitHub
- How to remove unwanted Java imports in IntelliJ (alternative of eclipse Ctrl + Shift + O)
- How to Configure GitHub with Eclipse IDE in 2023
- How to use Content Assist in Eclipse IDE
- Enable Eclipse dark mode
- Fix: Eclipse Connection time out: github.com
- Java was started but returned exit code=13 [Eclipse]
- Java Decompiler Eclipse Plugin
- Add imports in eclipse shortcut key combinations
- Syntax error, parameterized types are only available if source level is 1.5 or greater [Java]
- [Eclipse] Enable or Disable print margin line
- Eclipse Error The JVM Shared Library JavaVirtualMachines does not contain the JNI_CreateJavaVM symbol
- How to reset Eclipse IDE Code Font
- How to comment out a block of code in Python - Python
- Upload a File in Microsoft SharePoint using PowerShell Script - SharePoint
- How to remove JetBrains Toolbox from Mac Startup - HowTos
- Using Document Map in Notepad++ - NotepadPlusPlus
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python] - Python
- How to Run PowerShell Script (Mac/Windows/Linux) - Powershell
- Java SE JDBC with Prepared Statement Parameterized Select Example - Java
- How to Initialize ArrayList Java with Values - Java