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 show console in Eclipse IDE
- How to Configure GitHub with Eclipse IDE in 2023
- Fix: Eclipse Connection time out: github.com
- Java was started but returned exit code=13 [Eclipse]
- [Fix] Spring Tool Suite STS Code Autocomplete not working with Eclipse
- [Eclipse] Enable or Disable print margin line
- Eclipse Java: Multiple markers at this line error
- Java Decompiler Eclipse Plugin
- Compare Current and Previous Versions of Same File (Local History) in Eclipse
- Eclipse Error : The Eclipse executable launcher was unable to locate its companion shared library.
- Word-wrap Eclipse Console logs
- eclipse maven m2e : Cannot complete the install
- How to Save Eclipse console logs in external log file
- List of Code Snippets/Templates to Eclipse IDE
- How to Access Terminal (Command Line) in Eclipse IDE
- Installing JD Decompiler plugin in Eclipse IDE
- How to Reset Eclipse Theme to Classic
- Increase Font Size of Eclipse Java Code
- Eclipse: Updating Maven Project. Unsupported IClasspathEntry kind=4
- INVALID FILE NAME: MUST CONTAIN ONLY [a-z0-9_.] Android Eclipse Error
- Fix: Eclipse Cant Connect to any repository not Authorized Error GitHub
- [Eclipse] Syntax error, annotations are only available if source level is 1.5 or greater
- Add imports in eclipse shortcut key combinations
- Eclipse version 32-bit or 64-bit check on macOS
- How to create a Git Project in Eclipse (Step-by-step)
- [fix] zsh: command not found: git - Git
- Fix: error: legacy-install-failure Python pip/pip3 - PIP
- Java Split String by Spaces - Java
- [Solution] IDEA IntelliJ System.out.println function shortcut (sysout alternative for eclipse IDE) - HowTos
- Copy entire directory using Terminal Command [Linux, Mac, Bash] - Linux
- Python: How to add Progress Bar in Console with Examples - Python
- macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing - MacOS
- Check Android Studio App is M1/M2 Chip based post installation - Android-Studio