Accepted answer

I'm pretty sure he has Ctrl + Shift + O in mind, but I may be wrong.


In Preferences->General->Key, you can have your bindings for shortcut key. This article: Eclipse Short Cut Keys lists some useful shortcuts.


The easiest thing to do is to start typing the type name, then press Ctrl + Space to get the completions. Selecting the completion will complete the type name that you are typing and will also add the import statement. Short of that, there is Ctrl + 1, which will bring up quick fixes when you are over a piece of code with problem. There is typically a quick fix to import type.


some useful Eclipse shortcuts, you need first one

1. Ctrl + Shift + O : Organize imports

  1. Ctrl + D : Delete row

  2. Ctrl + 1 : Activate quick fix

  3. Ctrl + O : Open declarations

  4. Ctrl + / : Line Comment

  5. Alt + Shift + R : Rename selected element

  6. Ctrl + Shift + L : Shortcut for shortcuts

if you need more refer here


For Mac users the shortcut is:

CMD + Shift + O


You can use Ctrl + Shift + O to "O"rganize Imports (like Crembo mentions). Another neat trick is to go to Windows > Preferences, search for "Save Actions", and check "Organize Imports". Now whenever you save (Ctrl + S), Eclipse will automatically run the "organize imports" feature. I find this quicker, since it's quicker for me to hit Ctrl + S than Ctrl + Shift + O (one-hand shortcut versus two-hand shortcut).

Related Query

More Query from same tag