Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij can not recognize java.util.List

When I input List in Intellij, it doesn't automatically provide a prompt for importing java.util. I have to import java.util.List manually.

When I write java.util, it doesn't prompt to add List, but instead ArrayList.

like image 493
lolita Avatar asked Dec 23 '15 07:12

lolita


People also ask

Do not import * IntelliJ?

To avoid IntelliJ IDEA replacing imports with * , you need to configure the Class count to use import with '*' and Names count to use static import with '*' preferences: Go to Preferences > Editor > Code Style > Java.

How do I enable auto import in IntelliJ?

IntelliJ IDEA does not have an action to add imports. Rather it has the ability to do such as you type. If you enable the "Add unambiguous imports on the fly" in Settings > Editor > General > Auto Import, IntelliJ IDEA will add them as you type without the need for any shortcuts.

How do I get rid of wildcard imports in IntelliJ?

The solution is to go to Preferences ( ⌘ + , on macOS / Ctrl + Alt + S on Windows and Linux) > Editor > Code Style > Java > Imports tab set Class count to use import with '*' and Names count to use static import with '*' to a higher value. Any value over 99 seems to work fine.


1 Answers

Please check File | Settings | Editor | General | Auto Import | Exclude from Import and Completion. If "java.util.List" is there, remove it.

like image 104
Peter Gromov Avatar answered Oct 20 '22 20:10

Peter Gromov