Can eclipse be configured to automatically fix missing Imports?

Can eclipse be configured to automatically fix missing Imports?

I think you are looking for Ctrl + Shift + O

n

You can also set up Eclipse to automatically organize imports on save:

n

Preferences > Java > Editor > Save Actions

Ctrl + Shift + O (Cmd + Shift + O for mac) – Organize all imports
nCtrl + Shift + M (Cmd + Shift + M for mac) – Import one by one (you need cursor on the red marker)

Can eclipse be configured to automatically fix missing Imports?

b’

Eclipse: Automatically fix missing imports

n

1. macOS

n

a) Organize all imports

n

Command + Shift + O

n

b) Add import for a specific line

n

Command + Shift + M

n

2. Windows

n

a) Organize all imports

n

Control (Ctrl) + Shift + O

n

b) Add import for a specific line

n

Control (Ctrl) + Shift + M

Leave a Reply

Your email address will not be published.