How to prevent Eclipse from cleaning the bin folder for every build?

zw324 picture zw324 · Jun 14, 2011 · Viewed 11.2k times · Source

I am now doing a project using Eclipse, and I have some resource files (e.g., image, text) saved in the bin folder, and these files are needed by the program.

However, with every build, Eclipse would try to clean up the folder, then rebuild the project. When cleaning, it deletes the resource files in the folder. Is there anyway to stop Eclipse from doing this?

I know I could change the location of the files, but I am also curious why Eclipse would do this, and could this be prevented from happening.

Thanks!

Answer

usr-local-ΕΨΗΕΛΩΝ picture usr-local-ΕΨΗΕΛΩΝ · Apr 14, 2014

Go to Options -> Java-> Compiler -> Building and uncheck Scrub output folders when cleaning projects.

That did the trick for me. In my project, I have an Ant task that adds a few configuration resources to the bin folder to include them in the classpath, without having them in src