Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off Eclipse warning "The import is never used"?

I have a lot of this warnings in project and I would like to turn it off. I'm not interested in removing those imports, so please don't tell me how to do it.

I'm using eclipse 3.4.2.

like image 954
IAdapter Avatar asked Feb 15 '11 15:02

IAdapter


People also ask

How do I fix an import error in Eclipse?

To fix this error, you must include the appropriate JAR file. External JAR files for a project are set in the Properties dialog. So are many other project attributes.

What is the shortcut to remove unused imports in Eclipse?

To remove those unused imports automatically, just click on the class and press the shortcut “Ctrl + Shift + O” to initilize the “Organize imports” feature.

Where are unused imports in Eclipse?

Eclipse provide a shortcut CTRL + SHIFT + O, this shortcut command will remove all those unused imports from your code file.


1 Answers

If you have a file org.eclipse.jdt.core.prefs then you can add org.eclipse.jdt.core.compiler.problem.unusedImport=ignore.

When using vscode this file should be seen from the project root in a folder .settings.

like image 179
clankill3r Avatar answered Oct 22 '22 00:10

clankill3r