javacompilationpackage

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/Node.java stacks/LinkedList.java stacks/LLTestCase01.java

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


Solution

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