In this phrase, we first use the javac compiler to compile our Java source into a HelloWorld.class file. Then, we can execute the HelloWorld program using the java command and passing the name of the compiled class, HelloWorld. Note that you do not include the .class extension when passing the name to the java command. The java executable is included with either the Java JDK distribution or the Java JRE distribution. This program is used to execute your compiled Java class files. The Java executable can be thought of as the interpreter that compiles your bytecode real-time into executable native code that runs on the platform you are executing on. The Java executable is a platform dependent piece of Java. Each platform that supports Java will have its own Java executable compiled specifically for that platform. This piece of Java is also called the virtual machine. |