How can I hide all errors from an Eclipse project?

2019-02-17 05:26发布

问题:

I have taken a huge project from one of my friends and I just want to view the files just to understand some coding architectures they have implemented. On my system I don't have those jars and complete code so my Eclipse is showing almost 10,000 errors. Now I am still able to go through the code but the red errors are not allowing me to concentrate well. How can I hide all the errors in this particular project?

回答1:

I don't know if you can hide all the errors but you can

  • limit the number of reported problems in Preferences -> Java -> Compiler -> Building, or
  • exlude all the files from your build path folder (Java Build Path -> Souce -> Select source folder and Edit... -> Enter folder name and press Next -> Add '**' as Exclusion pattern)


回答2:

Just disable JavaBuilder in Properties -> Builders. Sometimes after disabling JavaBuilder error status is not updated (they are still visible). In that case do the following:

  1. In Properties -> Java Build Path -> Source remove source folder(s)
  2. Clear project using Build -> Clear...
  3. Disable JavaBuilder as described above
  4. Add source folder(s) again

That way you should not be irritated with error messages any longer, but retaining all the possibilities to navigate by ctrl+click, search references etc.



回答3:

This is not the right way , just a workaround if you just want to browse the source code and not worried about compile and building it.

You just need to remove the source folder in the java build path , this will help you to get rid of those red errors that clutter your source.

Right click on Project->Properties->Java Build Path->in Source tab select your source folder and click remove.

Restart your eclipse.