Let's get started with a Microservice Architecture with Spring Cloud:
Auto-import Classes in IntelliJ
Last updated: February 19, 2026
1. Overview
This brief tutorial will describe each option of IntelliJ IDEA’s ‘auto-import’ feature.
2. Auto-import
There are several options in IntelliJ IDEA that we may configure in Settings > Editor > Auto Import:
Let’s review each of these options.
2.1. Show Import Tooltip
When enabled for Classes, IDEA will underline a class reference in our code and suggest an import to add:
If there are several options to choose from, Idea will let us choose an import from a list of alternatives:
When enabled for Static methods and fields, IDEA will underline a method/field reference in our code and suggest an import to add:
2.2. Optimize Imports on the Fly
This one will make IDEA remove unused imports automatically and rearrange others according to the ‘Code Style’ preferences.
2.3. Add Unambiguous Imports on the Fly
Also, there is a way to automatically add an import as we add references to classes that need to be imported.
3. Conclusion
Some developers prefer to have total control over the imports in their classes, others rely on the IDE to handle this technical task.
Either of them may benefit from various configuration options that IntelliJ IDEA IDE has, including those for importing behavior.
















