Community
Participate
Working Groups
When you create a Java project and identify your top level source directories, it would be nice to be able to associate an implied package hierarchy (ex. com.mycompany.myproject) with the folder. JDT seems to demand that the source structure mirrors the build structure. While this certainly isn't fatal, having 2 or 3 levels of empty directories just to satisfy the compiler is a pain. Please correct me if there is some way to acheive this effect that I'm unaware of.
Sorry I'm not sure I'm following you... do you want to say the source folder 'src' is equal to 'a.b.c'? A subfolder 'd' should be interpreted as a package 'a.b.c.d'?
Yes, that's exactly what I mean.
I am not fan of the proposal. I think you simply need a better UI to hide/collapse these uninteresting packages. If you use the package explorer, it does hide them though. Why are these folders bothering you ? Note that other compilers have the same behavior (e.g. try to compile X.java against a bunch of sources on your classpath. The bunch of sources has to be organized properly as well).
I agree it's a minor issue and that yes, the Package Explorer does show them collapsed, which is what makes this tolerable, but it just seems silly to have to have 3 levels of nothing just to satify the IDE. Sun's compiler doesn't really care as long as your compiling into a different destination from the source, which we're doing. No big deal though. Just a minor annoyance. I will admit to that. We've already broken down and added the layers of nothing. I just thought I'd throw it out there as a possible enhancement.
Your request makes sense, but in the light of an incremental compiler, we need things to be located at guessable locations to perform correctly. Javac or other compiler tools will not care about file locations if you pass them all onto the command line, but as soon as these sources are to be found through the classpath, they'd better be nested in package directory structures. We are no different in enforcing this rule everywhere. As per your last comment, I will close this defect, since it works as designed.