Differences Between JDK and JRE

If you are a Java developer, then knowing the common differences between JDK and JRE is a must. Differences between these two is often a well-known question and there is the probability of ending up in confusion when differentiating what is what. Also understanding these differences makes it easy for you to visualize things possibly in a logical manner.

Well known the differences between JDK and JRE as one is a software development kit and the other is a bundle that allows for a java program.

Java Development Kit (JDK):

Java development kit or the JDK contains the tools required to develop java programs, and also to compile and debug the programs as well as JRE. These tools include java compiler (javac) and the java application launcher (java), etc., JDK is sufficient if you just want to write a piece of code and compile it. You need not require JDK to run your program. In general terms, JDK is meant for programmers and is always targeted at the developers who want to develop the code and compile it. Tools required for compilation comes with JDK installation and without this you cannot create Java applications and programs.

Usually JDK comes as a self extracting file and in order to install it you just need to execute the archive file in the directory where you want to install the JDK. Following are the components of JDK:

  • Runtime Interpreter
  • Compiler
  • Applet Viewer
  • Debugger
  • Class File Disassembler
  • Header and Stub File Generator
  • Documentation Generator
  • Applet Demos
  • API Source Code

The runtime interpreter helps in running the java executable programs which are in the form of compiled byte code.

The compiler, applet viewer, class file disassembler, debugger, header and stub file generator, documentation generator are some of the primary tools used by the developers.

Applets demos can be said as interesting applet programs and API (Application Programming Interface) provides the complete source code for the Java API classes.

Java Runtime Environment (JRE):

JRE stands for Java Runtime Environment or the Java RTE which is used to run the compiled java programs. While JDK is meant to create and compile the code, JRE is mainly aimed at the execution of the code.  The Java programs are not natively supported by all the operating systems. So, JRE needs to be installed so as to run Java and its corresponding applications. JRE is available for multiple platforms like Windows, Mac, Linux etc.,

It is important to know that JRE cannot compile the code. JDK comes with its own JRE and in order to run any java program from any browser you have to install JRE in your machine and should also be able to enable your browser. JRE is smaller than JDK, so it requires less disk space. JRE is developed by Sun Microsystems and it includes code libraries, Java package classes (math, swing, util etc.), components, and other supporting files that are necessary to run the java programs and also the JVM.

Note that JVM (Java Virtual Machine) is an abstract machine that offers a runtime environment for the execution of the bytecode. JVM primarily supports Java and many other languages. All the languages that are supported by JVM are known as JVM languages. The program written in these languages is compiled into the bytecode and then executed by the JVM.

It is available both as a standalone environment and as a plug-in which allows Java applets to be run on a web browser. The important point to be noted here is you cannot run a java program without either JDK or JRE. This shows that JRE is dependent of JDK to run a program.

About Aditi Malhotra

Aditi Malhotra is the Content Marketing Manager at Whizlabs. Having a Master in Journalism and Mass Communication, she helps businesses stop playing around with Content Marketing and start seeing tangible ROI. A writer by day and a reader by night, she is a fine blend of both reality and fantasy. Apart from her professional commitments, she is also endearing to publish a book authored by her very soon.

1 thought on “Differences Between JDK and JRE”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top