Summary: | Can't find resources in source folder that has an output folder | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Kenneth Corbin <kencx> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.1.2 | ||
Target Milestone: | 3.0 M7 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Kenneth Corbin
2004-01-28 16:51:36 EST
Source folders are meant to contain sources. You can have them be an output as well, as you already know. If you separate their output, then they won't appear on the classpath at runtime. This is why the resources in there are copied also into the output automatically (except for .java files which are considered as sources, thus only generated .class files are necessary at runtime). If you want to have .java resources available at runtime, then you should store these into a class folder. It will be appended to the runtime classpath. Does this work ? If the resource files got copied to the output folder everything would be cool. But this isn't happening. Is there something I am supposed to do to declare them as resources? It makes sense that the source folder wouldn't automatically be added to the classpath, but I should be able to manually add it as a class folder in library tab without it complaining that it is a duplicate classpath entry. Well, we don't want the same thing to be made available twice. First, are these resources Java files or not ? The files in question are not .java files. They are pretty much all XML files with a .xml extension. Problem solved. Eclipse is copying all of the resource files when I ask it to build the project. My problem was that I was trying to run programs without building them, not realizing that it wasn't going to go through the build process first. It found the compiled classes just fine because I had built them with an Ant script, but the Ant script put the original source folder on the path rather than copy the resources to the class folder. So test programs ran fine under Ant, but not under Eclipse proper. Reopening to mark as invalid (no action was taken from the JDT Core team to fix this problem) User error. |