I have multiple .java files inside a folder (e.g temp/code/project)
I want a batch file that will compile and run these java files.
The batch file should create class files inside the same structure where java files are located starting with the classes folder (i.e classes/temp/code/project)
I don’t know how to write a batch file. Can any body help me with this? Thanks in advance.
Theoretically you should write the following:
If you have one class that depends on all other classes in your project it is enough to run javac with this class only: compiler will compile everything.
This is only example and a good exercise. In real life people use special build tools like good old Ant, Maven or newer Graidle or Buildr. I’d recommend you to take one of them.