What is the difference between JDK and JRE?
What are their roles and when should I use one or the other?
Join them; it only takes a minute:
|
|
|||||||||
|
|
JRE: Java Runtime Environment. It is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution. JDK: It's the full featured Software Development Kit for Java, including JRE, and the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs. Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It's all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK. Sometimes, even though you are not planning to do any Java Development on a computer, you still need the JDK installed. For example, if you are deploying a WebApp with JSP, you are technically just running Java Programs inside the application server. Why would you need JDK then? Because application server will convert JSP into Servlets and use JDK to compile the servlets. I am sure there might be more examples. |
|||||||||||||||||||||
|
|
Pablo is very right. This is just additional information: "The JRE" is, as the name implies, an environment. It's basically a bunch of directories with Java-related files, to wit:
The JDK is also a set of directories. It looks a lot like the JRE but it contains a directory (called |
|||||||||||||||||||||
|
|
|
|||||
|
|
From Official java website... JRE (Java Runtime environment):
JDK (Java Development Kit)
|
|||
|
|
|
One difference from a debugging perspective: To debug into Java system classes such as String and ArrayList, you need a special version of the JRE which is compiled with "debug information". The JRE included inside the JDK provides this info, but the regular JRE does not. Regular JRE does not include this info to ensure better performance. What is debugging information? Here is a quick explanation taken from this blog post:
|
||||
|
|
|
In layman terms: JDK is grandfather JRE is father and JVM is their son. [i.e. JDK > JRE > JVM ]
In other words 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. JVM : The Java Virtual machine (JVM) is the virtual machine that run the Java bytecodes. The JVM doesn't understand Java typo, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understandable 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 : Java Runtime Environment (JRE) The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network. It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications. Java Development Kit (JDK) The JDK is a superset of the JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications. Note that Oracle is not the only one to provide JDK. |
|||||||||
|
|
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 Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It's all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK. |
|||
|
|
|
Here's a simple response directly from Oracle http://docs.oracle.com/javase/7/docs/technotes/guides/ Java SE Runtime Environment (JRE) The JRE provides the libraries, Java virtual machine, and other components necessary for you to run applets and applications written in the Java programming language. This runtime environment can be redistributed with applications to make them free-standing. Java SE Development Kit (JDK) The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications. |
|||
|
|
|
If you want to run Java programs, but not develop them, download the Java Run-time Environment, or JRE. If you want to develop them, download the Java Development kit, or JDK JDKLet's called JDK is a kit, which include what are those things need to developed and run java applications. JDK is given as development environment for building applications, component s and applets. JREIt contains everything you need to run Java applications in compiled form. You don't need any libraries and other stuffs. All things you need are compiled. JRE is can not used for development, only used for run the applications. |
|||
|
|
|
JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. 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 is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools |
|||
|
|
|
jdk is necessary to compile to code and convert java code to byte codes while jre is necessary for executing the byte codes. |
|||||||||
|
|
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.
(Sources: GeeksForGeeks Q&A, Java Platform Overview) |
|||||
|
|
Jvm, Jre, Jdk these are all the backbone of java language. Each components work separately . Jdk and Jre physically exists but Jvm is an abstract machine that means it has not physically exists. JVM is subsystem of JDK and JRE which use to check intermediate code knows as Bytecode. It first load "class file" having .c extension generated by Java compiler (Javac) through JVM subsystem classloader and classified memory location (class area, stack, heap and pc registers) according to there use. Then check all Bytecode to ensure that it is return in java and all memory accessibility access by the network. After that interpretor work start, interpretor check whole program line wise line and finally result shown in console, browser and application through JRE (Java Runtime Environment) which runtime facilities. JRE is also a subsystem of JDK which provide runtime facilities like JVM, classes, executable file like .jar file etc. JDK stands Java Development Kit it contain all necessary components which used in programming like class, methods, swing, AWT, package, java (interpretor), javac (compiler), appletviewer(applet application viewer) etc. So final conclusion is it content every file which useful in developing an application weather it standalone or web based. |
|||
|
|
|
Simply : 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 |
|||
|
|
|
JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent. Java Virtual Machine (JVM) is a run-time system that executes Java bytecode. JRE is the environment (standard libraries and JVM) required to run Java applications. The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications. |
|||
|
|
|
suppose, if you are a developer then your role is to develop program as well as to execute the program. so you must have environment for developing and executing, which is provided by JDK. suppose, if you are a client then you don't have to worry about developing.Just you need is, an environment to run program and get result only, which is provided by JRE. JRE executes the application but JVM reads the instructions line by line so it's interpreter. JDK=JRE+Development Tools JRE=JVM+Library Classes |
|||
|
|
|
A clear understanding of these terms(JVM, JDK, JRE) are essential to grasp their usage and differences. JVM Java Virtual Machine (JVM) is a run-time system that executes Java bytecode. The JVM is like a virtual computer that can execute a set of compiled instructions and manipulate memory locations. When a Java compiler compiles source code, it generates a highly optimized set of instructions called bytecode in a .class file. The JVM interprets these bytecode instructions and converts them to machine-specific code for execution. JDK The Java Development Kit (JDK) is a software development environment that you can use to develop and execute Java applications. It includes the JRE and a set of programming tools, such as a Java compiler, interpreter, appletviewer, and document viewer. The JDK is implemented through the Java SE, Java EE, or Java ME platforms. JRE The Java Runtime Environment (JRE) is a part of the JDK that includes a JVM, core classes, and several libraries that support application development. Though the JRE is available as part of the JDK, you can also download and use it separately. For complete understanding and details : Jdk Jre Jvm and differences |
|||
|
|
|
JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications. JRE is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution. JDK is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. So, Basically JVM < JRE < JDK as per @Jaimin Patel said. |
|||
|
|
|
The difference between JDK and JRE is that JDK is the software development kit for java while JRE is the place where you run your programs. |
|||
|
|
protected by Ed Cottrell♦ Sep 2 at 17:07
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

