When I imported a new project I could not build it because of “Resource already exists on disk” errors like this.
The simple fix was to remove the directory, typically classes, which contained the file it was complaining about and then refreshing. Removing just the file and then refreshing did not work.
However when I would do an ant build later and then refresh my project I would get the same error.
The better solution is to tell Eclipse not to copy the files it is complaining about to the output folder.
- Go to Project Properties.
- Select Java Compiler -> Building.
- In the Filtered resources box add the files you don’t want copied.
- Rebuild project.
Here is a screenshot showing how I added “*.properties, *.xslt” to the Filtered resources to fix this problem.