Writing a compiler? Seems to me there's a few ways you could look at it. Each file is it's own tree, sure. Of course you can't compile a single java file without taking other things into account. You could probably view the package hierarchy as a tree, with either source code or a pre-compiled class at each node. I don't think you'd need anything outside of that. I'm trying to think of how classloading could come into play during compilation and I don't think it can...