So far I have been able to compile my Java programs in Linux using javac command in Terminal, but soon I’ll need to compile a program that has two or three classes in it along with main and I’m not sure how this will work.
Can I still use javac command for this?
Ideally you would use a build system such as Maven, ANT, etc
If you are just compiling classes which are in the current working directory, and you have not used packages, you can quite happily use
If you have used some packages (and have put the files in their correct package directories) you can use
When you get to a large number of files, you will need to list them in a file and reference that via a
@argument, egBut ultimately a build tool will make life a lot easier.