How to suppress Java warnings for specific directories or files such as generated code

Starting with version 3.8 M6, Eclipse (to be exact: the JDT) has built-in functionality for this. It is configurable through a project’s build path: Project properties > Java Build Path > Compiler > Source

enter image description here

Announced here: Eclipse 3.8 and 4.2 M6 – New and Noteworthy, called Selectively ignore errors/warnings from source folders. That’s also where the screenshot is from. This is the new feature developed on the previously linked Bug 220928.

Leave a Comment