Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can eclipse be configured to automatically fix missing Imports?

Tags:

eclipse

Because they didn't make it easy enough already ;)

like image 207
NorthIsUp Avatar asked Oct 20 '10 22:10

NorthIsUp


People also ask

How do I fix all imports in Eclipse?

Press: CTRL + SHIFT + O and you should see below dialog boxes. Choose your desired import package and click next. It will prompt you for your next import and thats it. You are done.

Does Eclipse auto import?

Auto Import Java Class In Single Java File. Input the class name in the java source file. Click Source —> Organize Imports menu item or Shift+Ctrl+O in Eclipse, then the java class will be imported in the java source file automatically.

How do I manage imports in Eclipse?

Go to Window > Preferences > Java > Editor > Save Actions. Select Perform the selected actions on save (off by default). Ensure that Organize imports is selected (on by default).

Why import option is not working in Eclipse?

Try this: Go to Preferences » Java » Editor » Content Assist » Advanced. Make sure Other Java Proposals is ticked/checked. If that does not work simply close the project and reopen it.


1 Answers

I think you are looking for Ctrl + Shift + O

You can also set up Eclipse to automatically organize imports on save:

Preferences > Java > Editor > Save Actions

like image 154
Fabian Steeg Avatar answered Oct 01 '22 05:10

Fabian Steeg