This is also a popular interview question if you are going for two to four years of experience. Let’s understand in this way. Imagine whole human body as JDK, hands and legs as JRE and heart as JVM. Let’s see one by one.
Java Development kit(JDK) –
- JDK stands for java development kit, is a main component which contains JRE,JVM and JIT.
- JDK used to develop and run the java program.
- Observe the below diagram, we have JRE inside JDK.
Java Runtime Envirnment (JRE) –
- JRE contains JVM which is used to run java program.
- Inside JRE we have bin and lib.
3. Bin folder contains different types of dll files and exe files. We can see jvm.dll here.
4. Lib folder contains different jar files. One of important jar is rt.jar which contains all classes and interfaces which belongs to lang,util and io package.
Java virtual machine (JVM) –
- JVM stands for Java Virtual Machine, is heart of java programming language.
- It provides interpreter and JIT.
- JVM converts java byte code to machine language.
Just In Time Compiler(JIT) –
- JIT stands for just in time compiler.
- It instruct interpreter to execute java byte code fast. It is used to improve the performance of java program execution.