
When concerning the JDK, the important question may not be what it is, but what is it made up of? This is a concept that I’ve been struggling with since I first learned it. I sometimes, even after weeks of studying it and being prompted about, get the parts mixed up between the three ‘sections’ of the JDK. In this blog we’ll go over the sections of the JDK, including the JVM and JRE and everything in between. We’ll start from the smallest section and go up, starting with…
Java Virtual Machine
JVM is a virtual machine that allows Java to be platform independent. It is one of the main contributors to the idea of Java programs being “write-once-run-anywhere” programs. It uses an interpreter to execute the Java programs written using JRE and JDK by converting Java bytecode to machine specific code instead of worrying about the computer needing to have some underlying operating system and hardware to run Java on. This also helps to manage and optimize program memory. JVM comes packaged within the JRE and JDK.
Java Runtime Environment
JRE specifically includes the JVM as well as the standard Java APIs which are core classes and supporting files. This installation package contains just enough to execute, run, a Java application but not enough to compile one. If you want to only execute a Java program, you only need the JRE. The JRE alone is most often used by end users. The JRE doesn’t contain anything used to develop a Java Program which brings us to the title of this blog.
Java Development Kit
JDK includes the JRE(also the JVM by extension) as well as the Java compiler and other tools used to compile and debug code like debuggers. This is where everything comes together to develop a Java program. This package has the development tools to offer an environment to create, test and squash bugs in your program while the JRE can execute your program. The JDK is needed for Java Developers alone. JDK is platform-specific and has to be installed especially for each operating system. It can be said that JDK is the superset of the JRE along with the Java compiler, debugger and core classes.
This concept is deceptively simple looking, but it does come up a lot on interview questions for Java lists, so getting the differences between the three is essential to have in your back pocket.
More references can be found at the following links: Note that I made my own diagram for the introduction above, but the GeeksforGeeks has a very clean diagram as well that may help you remember the sections of the JDK well.