How to import all missing Java packages at once in Eclipse IDE

Last updated
App Shah

Crunchify » Eclipse IDE Tutorials » How to import all missing Java packages at once in Eclipse IDE

Import all missing packages at once in Eclipse IDE - Crunchify Tips

The most effective way to import all missing packages at once:

  1. Open Eclipse
  2. Open class where imports should be
  3. Press: CTRL + SHIFT + O

Sample:

  1. Get code from previous example: “Java: Simple Way to Write XML (DOM) File in Java
  2. Remove all imported packages
  3. Press: CTRL + SHIFT + O and you should see below dialog boxes
  4. Choose your desired import package and click next
  5. It will prompt you for your next import and thats it
  6. You are done
Command Shift O on Mac OS to add missing imports
Ctrl Shift O on Windows to add missing imports

I hope above simple steps will help you import all missing imports without even using mouse with simple command.

3 thoughts on “How to import all missing Java packages at once in Eclipse IDE”

  1. I’m using Eclipse 2019 and this doesn’t appear to work with static imports. Specifically the Collectors.toList(). I had .collect(toList()) and couldn’t get it to create the static import.

    Reply
    • Hi Kari – can you share a screenshot from your Eclipse?

      Are you getting any error? Above steps should work as it is 🙂

      Reply

Leave a Comment