Difference between JDK, JRF and JVM

1. JDK (Java Development Kit):

JDK is an acronym for Java Development Kit. It includes tools for writing, compiling, and debugging Java programs. Developers use JDK to write, compile, and debug Java applications. The Java Development Kit (JDK) is a software development environment which is used to develop Java applications and applets. It physically exists. It contains JRE + development tools.

  • Components:
    • JRE: JDK includes JRE (Java Runtime Environment).
    • Compiler (javac): Converts Java source code into bytecode.
    • Development Tools: Includes tools like a debugger (jdb), a documentation generator (javadoc), and an archiver (jar).

2. JRE (Java Runtime Environment):

JRE is an acronym for Java Runtime Environment. Provides the necessary environment to run Java applications. JRE is responsible for running Java bytecode on any platform. The Java Runtime Environment is a set of software tools which are used for developing Java applications. It is used to provide the runtime environment. It is the implementation of JVM. It physically exists. It contains a set of libraries + other files that JVM uses at runtime.

  • Components:
    • JVM: JRE contains the JVM to execute Java programs.
    • Libraries: Provides Java class libraries, including core libraries like java.util and java.lang.

3. JVM (Java Virtual Machine):

JVM is an acronym for Java Virtual Machine. The core component of the Java environment that executes Java bytecode. JVM provides a runtime environment and converts Java bytecode into machine-specific instructions. JVM is part of both JDK and JRE and is the component that allows Java programs to run on any device or operating system. It is called a virtual machine because it doesn’t physically exist. It is a specification that provides a runtime environment in which Java bytecode can be executed. It can also run those programs which are written in other languages and compiled to Java bytecode.

  • Components:
    • Class Loader: Loads classes at runtime.
    • Execution Engine: Executes the bytecode.
    • Garbage Collector: Manages memory by removing unused objects.

Leave a Reply

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