Thursday, June 18, 2026

1.5 JVM, JDK and JRE

                                          JDK (Java Development Kit)

        The Java Development Kit (JDK) is a software development package used to develop, compile, and run Java applications.

        JDK Includes a complete JRE (Java Runtime Environment) plus tools for developing, debugging, and monitoring Java applications.

        JDK is required to build and run Java applications and applets.

  

The diagram shows how Java (JDK) relates to the JVM and JRE:

  • JDK = tools + runtime for developing Java programs
    • It includes JRE (the runtime to run Java) plus development tools like javac, jar, etc.
  • JRE = Java runtime environment to run Java apps
    • It contains the JVM (executes bytecode) and the libraries/other files needed to run them.

         Components of JDK

1. Java Compiler (javac)

Converts source code (.java) into bytecode (.class)

2. Java Runtime Environment (JRE)

Provides environment to run Java programs

3. JVM (Java Virtual Machine)

Executes bytecode

4. Development Tools


Java Runtime Environment (JRE)

        The Java Runtime Environment (JRE) is the software package required to run Java programs.

        JRE : provides the libraries((API)), the Java Virtual Machine, and other components to run applets and applications written in the Java programming language.

        JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.

        jre

 

Java virtual Machine(JVM)

        Java virtual Machine(JVM) is a virtual Machine that provides runtime environment to execute java byte code. 

        It converts bytecode (.class files) into machine code..

        JVMs are available for many hardware and software platforms. The JVM performs following main tasks:

         Loads class files: The JVM loads compiled .class files into memory so they can be prepared for execution.

        Verifies bytecode: The JVM checks the bytecode to ensure it is valid, safe, and follows Java’s security and language rules before execution.

        Executes bytecode: The JVM translates bytecode into machine-level instructions and runs the program on the host system.

        Manages memory: The JVM allocates, organizes, and automatically reclaims memory using garbage collection.

        Provides security: The JVM protects the system by preventing unauthorized access, illegal operations, and unsafe code execution.

 

 






No comments:

Post a Comment

2. 0 java Class

}   Class can be defined in multiple ways Ê   A class is a blueprint for an object. Ê   A class is a user-defined data type. Ê   A cla...