Java is a platform independent programming language using
which one can write a program that can run under any kind of OS.
It is also architectural neutral because the Java compiler
does not generate object code which is machine dependent; rather the source
file of a Java program is converted to byte code. To run this byte code we need
an interpreter which is called Java Virtual Machine (JVM). Once the JVM is
implemented then any Java program can be executed irrespective of the hardware
architecture of the computer.
Later on in Java 2, a run time compiler has been added which
generates executable code from the byte code on a piece by piece basis. That
run time compiler is called Just In Time (JIT).