While the Java specification doesn't enforce it, all well-known compilers use directory structures. The specification explicitly states a database for storage of classes, which wouldn't use any directories at all.
Short answer: If you're using standard Java tools, you can't avoid nested directories.
7.2. Host Support for Packages
Each host system determines how packages and compilation units are created and stored.
...
In simple implementations of the Java SE platform, packages and compilation units may be stored in a local file system. Other implementations may store them using a distributed file system or some form of database.
If a host system stores packages and compilation units in a database, then the database must not impose the optional restrictions (§7.6) on compilation units permissible in file-based implementations.
...
Systems that use a database must, however, provide an option to convert a program to a form that obeys the restrictions, for purposes of export to file-based implementations.
(It sounds like you're working around the real problem.)