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

Btw, one very good shortcut is ctrl+shift+o that cleans those imports automatically.

Also it is possible to put so that in every save imports are automatically organised from:

window->preference->java->editor->save actions

If you prefer to leave those imports there, it is ok. But that is to anyone else :)

Also I am not sure about 3.4 version.


To change for the entire workspace:

Window > Preferences > Java > Compiler > Errors/Warnings > Unused Import > Ignore.

To override workspace settings for a single project:

Project > Properties > Java Compiler > Errors/Warnings > Unused Import > Ignore.


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.


@SuppressWarnings("unusedImports") disables just unused imports as opposed to al unused items