
The code is developed in either a plain text editor or an Integrated Development Environment (IDE) and saved to a file with a .java extension. It is then checked for syntax errors by the Java Compiler (javac.exe). If successfully compiled, the resultant .class file is passed to the Java Virtual Machine (java.exe) for execution.
The act of compiling has a two-fold effect: Firstly, the code is checked for syntax errors and secondly, the code is converted to byte codes. The byte codes are instructions for an imaginary machine called the Java Virtual Machine (JVM). This machine is emulated by all Java interpreters and therefore allows you to execute a compiled Java program among different platforms (operating systems with a JVM).