How do you compile all classes in a package from the command line?

I have three separate class files in a package called stacks. How can I (recursively?) compile every class so I don't always have to type the following:

javac stacks/ stacks/ stacks/

There will be more classes added so I don't want to keep expanding this compile list.


  • Try javac stacks/*.java. That's all you need.