What is JVM?

Java Virtual Machine (JVM) is a virtual Machine that provides runtime environment to execute java bytecode.

JVM image

Java programs are saved in .java file, JVM cannot understant java source code, it understands java bytecode. When we compile the java souce code the compiler generates bytecode (.class file), to run the program we pass the bytecode to JVM which translates it into machine code.

Java source code is nothing but your java code save with .java file extensionion for example

Java bytecode is generated when we compile source code. It is saved in a file with .class extension for example HelloWorld.class

What is JRE?

Java Runtime Environment (JRE) is an environment where JVM runs. We can say JRE is a container which contains JVM, class libraries and other runtime libraries.

JRE image

If you want to run any java application on your system, you need to have JRE installed in your system.

In simple words JRE = JVM + class libraries

What is JDK?

Java Development Kit (JDK) includes JRE and java development tools. To start java development you need to install JDK. JDK provides java compiler, java disassembler, java debugger and other tools required for java development.

JRE image

Basic tools what JDK provides are as following java, javac, javap, jdb, javadoc, jar, apt, appletviewer. They are the tools you use to create and build applications. JDK also provides so many other tools for security and other purposes.

In simple words JDK = JRE + Development tools

Next Chapter

In next chapter we will see how to install and configure java in your system, to create and run java programs.