tags:

views:

53

answers:

1

Hi, Today when I compile my java sources the eclipse deletes all the class folder content (also files which are not classes) and recreate all the classes.

This is not good for me, is it possible to configure the eclipse not to delete all the classes folder content but just to run over all the classes instead?

+4  A: 

The classes folder is not a good place to store your resources, it is supposed to be a pure output folder.

If you need non-classes on your classpath, you simply need to put them somewhere on the source path, Eclipse will copy them to the classes directory. This means you can do one of two thngs:

  • Simply mix your resources with your .java files in the same source-path
  • create a separate source-path just for your resources (call it "res" for example) and keep your .java files and your resources separate.
Joachim Sauer
+1 I think that the second option is better by far.
ATorras
Thank you for your answer.Even though you are 100% right, I can't change the structure of the project.I would, however, like to make my work more efficient by making the change I asked in the question. So, is it possible?
Avi Y
@Avi: why is that not possible? if it really isn't possible, then make "classes" an additional source folder and set it as the target binary folder for both src and classes (I think thats possible by setting some "yes-i-know-that's-a-bad-idea" switch).
Joachim Sauer