What is difference between JDK, JRE and JVM?
What is the difference between JDK, JRE and JVM in Java?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sundaram SubramanianPosted Jun 22, 2017, 6:23 AM
JVM
JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.
JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.
The JVM performs following main tasks:
JRE
JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM. It physically exists. It contains set of libraries + other files that JVM uses at runtime.
Implementation of JVMs are also actively released by other companies besides Sun Micro Systems.
JDK
JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools.
Naveen ArumugamPosted Jun 28, 2017, 3:06 AM
Rajkiran SwainPosted Jun 22, 2017, 12:20 PM
JVM
The Java Virtual machine (JVM) is the virtual machine that runs the Java bytecodes. The JVM doesn't understand Java source code, that's why you compile your
*.javafiles to obtain*.classfiles that contain the bytecodes understood by the JVM. It's also the entity that allows Java to be a "portable language" (write once, run anywhere). Indeed, there are specific implementations of the JVM for different systems (Windows, Linux, MacOS, see the Wikipedia list), the aim is that with the same bytecodes they all give the same results.JDK and JRE
To explain the difference between JDK and JRE, the best is to read the Oracle documentation and consult the diagram: