Just-In-Time (JIT) compilation

Java is designed to run on every target platform without the need for an expensive compiler to recompile Java source code to machine code for each platform. To achieve this, Java introduced the concept of Just-In-Time (JIT) compilation, which combines both compiler and interpreter technology. This allows Java programs to run on any platform that has a Java Virtual Machine (JVM). The JVM compiles Java source code into an intermediate language called bytecode. This bytecode is platform-independent and can be executed on any system with a JVM. The JIT compiler, which is part of the JVM, converts the bytecode into machine code at runtime, allowing the program to run on the host machine. One of the benefits of JIT compilation is that it enables Java to strike a balance between the advantages of interpreted languages (such as portability and flexibility) and the performance benefits of compiled languages (such as C and C++). By using JIT compilation, Java provides high performance while maintaining flexibility and portability.

Bytecode

Bytecode is an intermediate code which is different from native machine code and cannot run as such on the host platform. Bytecode is a set of instructions for the JVM, the bytecode will be interpreted by the JVM into machine code for a specific platform.


Back to parent page: Java Platform

Web_and_App_DevelopmentProgramming_LanguagesJavaJITBytecode