Java: How can I compile an entire directory structure of code ?

euphoria83 picture euphoria83 · Jan 22, 2011 · Viewed 145.2k times · Source

The use case is simple. I got the source files that were created using Eclipse. So, there is a deep directory structure, where any Java class could be referring to another Java class in the same, child, sibling or parent folder.

How do I compile this whole thing from the terminal using javac ?

Answer

Manidip Sengupta picture Manidip Sengupta · Jan 22, 2011

You have to know all the directories, or be able to use wildcard ..

javac dir1/*.java dir2/*.java dir3/dir4/*.java dir3/dir5/*.java dir6/*src/*.java