JDK, JRE, JVM Diagram

What is the Difference Between the JDK, JRE, and JVM?

Reese Watson
3 min readApr 17, 2019

--

If you’re a Java software developing newbie like myself, you’ve been asked this question once or twice before (more than likely in an interviewing setting). And if you’re anything like me, you’ve tried to distinguish the differences and have had a significantly hard time doing so.

SO — I’m going to attempt to break it down into manageable bite-size pieces, so newbies like you and me can wrap our brains around these three Java staples. Let’s start with the meaning of these acronyms..

JDK represents the “Java Development Kit”.

JRE stands for “Java Runtime Environment”.

and JVM is simply the “Java Virtual Machine”.

Breaking it down— the JDK: both the JRE and JVM can be housed within the JDK. A JDK is used to 1) develop 2) execute and 3) display code. 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 (StackOverflow). If you are a developer interested in creating your own Java applications or applets, you will want to install a JDK. For developers who wish to work in an integrated development environment (IDE), a JDK bundled with Netbeans can be downloaded from the Oracle website (Techopedia). There are different JDKs to suit a wide variety of platforms. In a nutshell, the JDK is a Java software development environment, used by developers to create and manage applications/applets.

OK! Now let’s get into the JRE: Simply put, the JRE represents the Java runtime environment. This is where code is 1) executed AND 2) displayed. The JRE contains a Java virtual machine, class libraries, and other supporting files. It is essential to running a Java application/applet. According to Techopedia, the JRE consists of the following components:

  1. Deployment technologies— including deployment, Java Web Start and Java Plug-in.
  2. Integration libraries — including Interface Definition Language (IDL), Java Database Connectivity (JDBC), Java Naming and Directory Interface (JNDI), Remote Method Invocation (RMI), Remote Method Invocation Over Internet Inter-Orb Protocol (RMI-IIOP) and scripting.
  3. Other base libraries — including international support, input/output (I/O), extension mechanism, Beans, Java Management Extensions (JMX), Java Native Interface (JNI), Math, Networking, Override Mechanism, Security, Serialization and Java for XML Processing (XML JAXP).
  4. Lang and util base libraries — including lang and util, management versioning, zip, instrument, reflection, Collections, Concurrency Utilities, Java Archive (JAR), Logging, Preferences API, Ref Objects and Regular Expressions.
  5. Java Virtual Machine (JVM), including Java HotSpot Client and Server Virtual Machines.

Newer JREs host several thousand classes and entirely new APIs have been introduced.

Finally, let’s talk about the smallest unit of the three: the JVM! The Java virtual machine displays Java applications/applets by essentially interpreting Java byte code into machine code. It is responsible for all the things like garbage collection, array bounds checking, etc… JVM is platform dependent (StackOverflow). It’s called “virtual” because it provides a machine interface that does not depend on the underlying operating system and machine hardware architecture. Thanks to the JVM, Java code can be written once and run anywhere (on any machine). In a nutshell, the JVM has two primary functions 1) to allow Java programs to run virtually on any device or operating system and 2) to manage and optimize program memory.

--

--

Reese Watson

Software developing noobe | Nature sponge | Proud Dog Mom to Max & Charlie | Adventure seeker | Jesus lover | Kayaking junkie | Crossfit novice | Psalm 34:10