Search code examples
javaeclipseimportdependenciespreferences

Can I configure Eclipse to import java.util classes when similar named classes exist?


Problem statement: When using java.util classes like List or Set, Eclipse will not auto import the java.util classes because other classes with the same name exist (mainly from java.swt).

Goal: Auto import for List will choose java.util.List without asking back.

The "Favorits" preferences page is only helpful for static imports. I would like something like that for normal imports.


Solution

  • You can configure a list of types to ignore in the Preferences in 'Java > Appearance > Type Filters'.

    Types you filter out will not be shown in content assist, quick fix, or the Open Type dialog.

    Example: Example type filters