smeeb
smeeb

Reputation: 29477

How to auto add imports in IntelliJ?

I am new to IntelliJ. I am writing some code and am seeing IntelliJ complain that it can't resolve a class/object:

enter image description here

It knows to suggest which import to add but I'm looking for a shortcut that will allow me to say "Yes, please auto add that import!". In Eclipse, this is as easy as Cmd+Shift+O...any ideas here?

Upvotes: 3

Views: 9542

Answers (2)

Aleksandr Baklanov
Aleksandr Baklanov

Reputation: 500

The question contains the answer :) I marked it with a blue circle.enter image description here

Upvotes: 0

Zbynek Vyskovsky - kvr000
Zbynek Vyskovsky - kvr000

Reputation: 18825

Alt-Enter is the shortcut. Actually it's general shortcut for fixing problems which the IDE understands.

Upvotes: 4

Related Questions