The JVM starts by interpreting bytecode, and the JIT compiles frequently executed (hot) methods and loops to native machine code at runtime.
HotSpot uses tiered compilation: C1 (client) compiles quickly with light optimization, then C2 (server) recompiles the hottest code with aggressive optimizations. Because it profiles the actual running workload, the JIT applies speculative optimizations — inlining, loop unrolling, dead-code elimination, escape analysis — that a static compiler cannot, and it deoptimizes back to the interpreter if a speculative assumption (e.g. a monomorphic call site) is later violated.
- Saying Java is interpreted only.
- Not knowing C1, C2 and tiered compilation.