The Oracle documentation points to the fact the source tree does not have to match the object files tree. javac lets anything go for that very reason, but java will require the directory structure to follow the standard of having one subdirectory per element of the dot-separated package name.