How to Set javac Output Directory?
You can specify the output directory using the -d option with the javac command. For example, to output compiled files to a directory named “output”, you can use the following command:
javac -d output MyFile.java
This will output the compiled .class file of MyFile.java into the output directory. If the output directory does not exist, javac will automatically create it.