Java is a high-level language, which represents logical computer concepts in a fashion that is
easier for humans to understand than low-level machine code or assembly language. However,
this means that in order to run on a machine, the code must be compiled into machine code or
interpreted by a special-purpose machine.
To achieve its goal of "Write once, run anywhere," Java does both: a Java compiler converts
Java code into machine-readable byte code, then the Java Virtual Machine interprets the code for
the computer it runs on. Individual computers often use different machine languages, so if you
compiled a Java program to a single machine language, the compiled program would not be able
to run on multiple machines.
To solve this problem, the Java Virtual Machine is a simulated machine which has multiple
implementations for each computers . Once Java code is compiled into JVM byte code , the byte
code then runs according to the JVM. The JVM then passes the actual processing work to the
processor in its own language. The JVM is part of the Java Runtime Environment