What is the difference between JVM, JDK, JRE & OpenJDK?
I was programming in Java and I encountered these phrases, what are the differences between them?
What is the difference between JVM, JDK, JRE & OpenJDK?
I was programming in Java and I encountered these phrases, what are the differences between them?
Another aspect worth mentioning:
JDK (java development kit)
You will need it for development purposes like the name suggest.
For example: a software company will have JDK install in their computer because they will need to develop new software which involves compiling and running their Java programs as well.
So we can say that JDK = JRE + JVM.
JRE (java run-time environment)
It's needed to run Java programs. You can't compile Java programs with it .
For example: a regular computer user who wants to run some online games then will need JRE in his system to run Java programs.
JVM (java virtual machine)
As you might know it run the bytecodes. It make Java platform independent because it executes the
.class
file which you get after you compile the Java program regardless of whether you compile it on Windows, Mac or Linux.Open JDK
Well, like I said above. Now JDK is made by different company, one of them which happens to be an open source and free for public use is OpenJDK, while some others are Oracle Corporation's JRockit JDK or IBM JDK.
However they all might appear the same to general user.
Conclusion
If you are a Java programmer you will need JDK in your system and this package will include JRE and JVM as well but if you are normal user who like to play online games then you will only need JRE and this package will not have JDK in it.
In other words JDK is grandfather JRE is father and JVM is their son.
In simple words :
JVM : A specification which describes the the way/resources to run a java program. Actually executes the byte code and make java platform independent. In doing so, it is different for different platform. JVM for windows cannot work as JVM for UNIX.
JRE : Implementation of JVM. (JVM + run time libraries)
JDK : JRE + java compiler and other essential tools to build a java program from scratch
JVM is the virtual machine Java code executes on
JRE is the environment (standard libraries and JVM) required to run Java applications
JDK is the JRE with developer tools and documentation
OpenJDK is an open-source version of the JDK, unlike the common JDK owned by Oracle
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.
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.
JDK
JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools.
Link :- http://www.javatpoint.com/difference-between-jdk-jre-and-jvm
JVM : this actually means the byte code interpreter .It is platform dependent. For eg: in Windows platform the 'java.exe' or 'javaw.exe' precess is the jvm process.
JDK : is a toolkit containing necessary libraries and utilities to develop and execute java program/application
JRE: is the execution environment for a java application.ie, it only support runtime dependencies including jvm for compiled program. If we want to compile a java program we need jdk.
JVM is the Java Virtual Machine – it actually runs Java bytecode.
JRE is the Java Runtime Environment – it contains a JVM, among other things, and is what you need to run a Java program.
JDK is the Java Development Kit – it is the JRE, but with javac (which is what you need to compile Java source code) and other programming tools added.
OpenJDK is a specific JDK implementation.