Community
Participate
Working Groups
This is probably related to bug 3245. I experience the problem on the Linux Motif M5 release. The JDT shouldn't attempt to compile Java files which aren't "Java resources". If I create a file ending in .java outside the source directory it doesn't attempt to compile it. If I create a file ending in .java inside the source directory it does. I think this behaviour is correct. If I place a file ending in .java inside the the source directory in a directory with a dot (".") in the directory name then this file is not a Java resource (according to bug 3245). However, the JDT still attempts to compile it. (It never succeeds because the compiler doesn't seem to handle the directory name.) This results in errors being attached to the Java file when I don't think they should be. Here is an example directory structure which demonstrates the problem: / +-- src/ +-- Compile.java <-- should compile +-- dont.compile/ +-- ShouldntHaveErrors.java <-- shouldn't try to compile this My problem with this is a little more complicated. I have files ending in '.java' which are stored throughout the source directory in directories called '.svn'. These are artifacts of the Subversion version control system (http://subversion.tigris.org/), analagous to 'CVS' directories, so I can't avoid them! Especially strange for me is the fact that I get errors reported for the '.java' files stored inside each '.svn' directory, but the directories aren't visible in the Java perspective. I'm not sure if this is a bug or not... should I file a report?
If you turn off the default filter in the Java perpsective (see the little triangle at the top of the package view) you would see them. Now for the behavior of the Java builder with respect to such folder names, I am not sure I do not want these to be flagged as being located in wrong package name. Usually this scenario is rather a mistake. Will defer, and may revisit post 2.0 if willing to introduce some filters on Java resources for building...
Deferring
Will reconsider post 2.0
Thanks for the pointer on filtering resources in the Package view. I was a bit confused about why the packages were being built if they couldn't be "seen" by Eclipse. This makes Eclipse's behaviour fine, in my view. Also, I think you are right that it should be an error to place Java files inside packages with dots in their name. Therefore I think Eclipse is correct to report the error. As an enhancement, you could consider mentioning the illegal directory name in the error message. For example, "Java file cannot be compiled in a directory with a dot in its name". I wouldn't consider this a big issue, however. Finally, my problem with Java files inside the .svn directory has been resolved. As of Subversion 0.14.3 the locally cached resources have ".svn-work" or ".svn-base" appended to their names. For example, a locally cached Java file might be stored under the filename "Class.java.svn-work". This works around the difficulties I had with the Eclipse builder. In conclusion, I am happy with the Eclipse's behaviour. Unless you wish to make either of the enhancements that have been mentioned in this report (filtering resources for the Java builder, changing the error message) you may wish to close it.
Excellent. Note also that you can tell the JavaBuilder to ignore the *.svn-* files alltogether. This means it won't attempt to copy them as attached resources (as it usually does). See the preference: Window>Preferences>Java>Compiler>Other>Filtered resources Also, for the dot package reporting, you currently will get an error message indicating that the package name doesn't match the expectation. The message isn't perfect in this scenario, but at least you get a notification that something is wrong with this very file around the package name. Closing following your advice
Reopening to close properly.
Closing