Because they didn't make it easy enough already ;)
Press: CTRL + SHIFT + O and you should see below dialog boxes. Choose your desired import package and click next. It will prompt you for your next import and thats it. You are done.
Auto Import Java Class In Single Java File. Input the class name in the java source file. Click Source —> Organize Imports menu item or Shift+Ctrl+O in Eclipse, then the java class will be imported in the java source file automatically.
Go to Window > Preferences > Java > Editor > Save Actions. Select Perform the selected actions on save (off by default). Ensure that Organize imports is selected (on by default).
Try this: Go to Preferences » Java » Editor » Content Assist » Advanced. Make sure Other Java Proposals is ticked/checked. If that does not work simply close the project and reopen it.
I think you are looking for Ctrl + Shift + O
You can also set up Eclipse to automatically organize imports on save:
Preferences
> Java
> Editor
> Save Actions
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