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

后端 未结 13 1622
太阳男子
太阳男子 2020-12-02 07:13

I\'m using a parser generator that creates somewhat ugly code. As a result my Eclipse project has several dozen warnings emanating from generated source files. I know I can

13条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 07:40

    This can be done by excluding certain directories from the build path (The following example is given using Eclipse 3.5)

    [1] Bring up the Java Build Path

    • Click on the projectin Package Explorer
    • Right click, properties
    • Select Java Build Path

    [2] Add directories to exclude

    • The Source tab should contain details of the project source folders
    • Expand the source folder and locate the 'Excluded:' property
    • Select 'Excluded:' and click Edit
    • Add folders into the Exclusion patterns using the Add/Add Multiple options
    • Click Finish, then ok for Eclipse to rebuild.

提交回复
热议问题