Community
Participate
Working Groups
Using Eclipse dated April 13 (200404131323), when I create a Java project and say it should have separate source and bin directories, and then I put a file in the source directory that is not a *.java file, that file is always copied to the bin directory during automatic workspace builds. Is that a bug? A feature? What's the intended use case for this? I don't want this behavior: in my situation, I want the user to create a source file which I will operate on with my own (non-Java) builder - why should the Java builder copy the file to the bin directory? STEPS TO REPRODUCE: * Create a Java project. In the creation wizard, say that it should have separate source and bin directories. * Make sure workspace auto-build is on. (Otherwise you'll hit a different bug I've filed). * Right-click the src directory of the Java project and say "New / File." * Give the file a random name like x.y. * Say OK to dismiss the new file wizard. The file is immediately copied to the bin directory, as you can see in the Resource perspective. It will always be copied, every time the Java builder runs over this project. (Or maybe only when it changes or is deleted from the bin directory.) Why?
From Help JDT FAQ: Why are all my resources duplicated in the output folder (bin, for example)? If your Java project is using source folders, then in the course of compiling the source files in the project, the Java compiler copies non-Java resources to the output folder as well so that they will be available on the class path of the running program. To avoid certain resources to be copied to the output location you can set a resource filter in the compiler preferences: Window > Preferences > Java > Compiler > Build Path How do I prevent having my documentation files from being copied to the project's output folder? Use source folders and put any resources that you do not want to be copied to the output folder into a separate folder that is not included on the class path.You can also set a resource filter in the compiler preferences: Window > Preferences > Java > Compiler > Build Path to for example *.doc.