"source not found" error
If the directory structure does not correspond to the package structure the source code is not found during debugging.
Leave a comment
on 2010-06-23 07:02 *
By David Bernard
IIRC, it's a requirement from Eclipse including for java code.
There are many assumptions baked into the JVM and associated tools relating to the way that classfiles can be mapped back to source files. In particular, note that classfiles only contain the leaf name of their corresponding source file, not the full path, so the only available option to locate it is to assume that the source file path prefix corresponds the class file path prefix (ie. the source is in the standard Java source package directory hierarchy). Multiple types contained within a single source file is fine, but ignoring the source package directory structure is a recipe for failure with all the IDEs and many command line tools (even scalac assumes the source package directory structure on occasions).
In summary, the advice you occasionally hear about ditching the Java conventions completely is extremely poor, based either on ignorance of the JVM specification or lack of interest in the standard Java tools: don't follow or propagate that misinformation.
In summary, the advice you occasionally hear about ditching the Java conventions completely is extremely poor, based either on ignorance of the JVM specification or lack of interest in the standard Java tools: don't follow or propagate that misinformation.