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.
- Top 45 Fresher Java Interview Questions - March 9, 2023
- 25 Free Practice Questions – GCP Certified Professional Cloud Architect - December 3, 2021
- 30 Free Questions – Google Cloud Certified Digital Leader Certification Exam - November 24, 2021
- 4 Types of Google Cloud Support Options for You - November 23, 2021
- APACHE STORM (2.2.0) – A Complete Guide - November 22, 2021
- Data Mining Vs Big Data – Find out the Best Differences - November 18, 2021
- Understanding MapReduce in Hadoop – Know how to get started - November 15, 2021
- What is Data Visualization? - October 22, 2021
This site is absolutely fabulous!