Is Java Compiled or Interpreted? JVM + JIT Explained
By Mohammad Alorfali ·
Java is both compiled and interpreted: javac compiles to bytecode, the JVM runs it, and the JIT compiles hot code to native machine instructions for performance.

Quick insight
People often say “Java is a compiled language.” The more accurate answer is that Java is both compiled and interpreted.
How Java runs: compile, interpret, then JIT
- 1.Compile:
javaccompiles source code into bytecode (.classfiles). Bytecode is portable and platform-independent. - 2.Run: the JVM loads the bytecode and interprets it so your app starts quickly.
- 3.Speed up: the JVM detects hot code and the JIT compiler compiles it into native machine code, applying optimizations.
- 4.Result: fast startup and high performance under steady load.
Conclusion
This is why Java is often summarized as “compile once, run anywhere.” You compile to bytecode once, and the JVM + JIT handle execution and optimization on each platform.
Written by Mohammad Alorfali, Senior Java Engineer in Dubai.
