A compiler is basically itself a program that reads a program written in the high level object oriented programming language and converts it into the machine or computer readable binary codes or language and at the same time, it also reports the errors in the program if any. Java compiler either converts the complete source code in one go or may take multiple passes to do so. However finally, the user gets the compiled code that is prepared to execute. This compiler generated target code file could be run with many alternative inputs, over and over. But you don't need or use the compiler for the sequent reruns. To know in detail about the Java compiler and more about Java, we recommend anyone to take up Java course.
Usually, the source code could be a high level language than the destination form, like when converting the C language to machine language. However converting from JavaScript 8 to JavaScript 5 is also a form of compilation.
Compiler usually operates on phases and numerous stages which are often classified into 2 phases that are: