There are multiple ways to compile a java program, eventually all other ways of java program compilations at end have to use the javac executable.
Compilation of java program can be done with a single java file or even more, the following are the basic steps for the compilation of any java program.
Java must be installed in the machine, where compilation takes place. If the Java is not installed, please check this post Install Java in Windows and install the Java.
Executable javac will generate one class file with the name of HelloWorld.class with in the same folder, it means compilation is successful.