Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Eclipse to automatically insert import statements for classes with a single package match

Tags:

java

eclipse

Is it possible to configure Eclipse so that it automatically inserts an import statement whenever a class name has just one package match ?

Note: "Preferences/Java/Editor/Content Assist/Insert single proposals automatically" is turned on

Thank you

like image 798
ikaushan Avatar asked Oct 11 '22 17:10

ikaushan


1 Answers

As @Bala R commented, Ctrl-Shift-O (Organize Imports) is the way to go.

"Insert single proposals automatically" is only for content assist - e.g. code completion.

like image 123
Matt Ball Avatar answered Nov 15 '22 11:11

Matt Ball