How to exclude a folder that is producing warnings/errors in an Eclipse project?

后端 未结 8 1416
长发绾君心
长发绾君心 2020-12-08 01:48

Okay. I\'m sick of this problem. This has to have an easy fix, I\'m sure of it!! I hope SO can help me to get rid of this once and for all!

8条回答
  •  [愿得一人]
    2020-12-08 02:34

    Configure your project (Project/Properties/Java Build Path/Source) to have, instead of the top level src folder with exclusions, just a list of the folders you do want to compile.

    Assuming Eclipse Helios, step by step:

    • Turn off autobuild (Project/Build Automatically).
    • Start with it empty.
    • Delete the errors by right clicking as in the link (just to be sure).
    • Add genuine source folders 1 by 1 (Project/Properties/Java Build Path/Source/Add Folder)
    • Do an explicit build (Project/Build Project).

    If that works, you should be able to turn autobuild back on. If it doesn't, something strange is going on. Perhaps the project is not using the standard Java Builder, but something like an Ant Builder (Project/Properties/Builders).

提交回复
热议问题