You may sometimes need to selectively include or exclude certain files or directories in an Eclipse project. For example, I had a
data subdirectory in my Eclipse project with thousands of files. Eclipse would spend lots of time needlessly indexing these files. This can be prevented by just excluding that directory from the project.
- Right-click on the project and choose Properties. Choose Resource -> Resource Filters.
In the Resource Filters dialog, click Add and choose which files and directories to either Include Only or Exclude All. Only provide the file or directory name, not a relative path or absolute path!
Refresh the project to update these settings. The excluded files or directories should disappear from the project.
If you are curious, Eclipse puts this setting in the
.project file for your project. For example, excluding a subdirectory named
zoomba in a project, resulted in Eclipse adding this XML snippet to the
Tried with: Eclipse Luna 4.4.2 and Ubuntu 14.04