The two-step compile and execute process – javac and java/javaw
The most common approach to running a Java program involves two steps. First, you must compile the code with javac and then execute the code in the Java Virtual Machine (JVM) with Java or on Windows with javaw.
The first step of preparing Java source code for execution is to compile it into bytecode. This is the machine language of the JVM. Every Java source file that is part of an application must be compiled into bytecode.
The second step is to execute the bytecode in a JVM. Unlike C or C++, there is no link step. The link step combines all compiled code into a single executable file. In Java, all the bytecode files must be on the classpath, which is the path to all bytecode files, and not necessarily combined into a single file. This may seem confusing as there is a tool called jlink, but its purpose is to combine the Java runtime with your code so that the end user does not need the Java version that...