<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ashish Bhoya  on Medium]]></title>
        <description><![CDATA[Stories by Ashish Bhoya  on Medium]]></description>
        <link>https://medium.com/@ashish.bhoya.56?source=rss-b8a3872cc733------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9Ov-DbVMWNtRfxhA</url>
            <title>Stories by Ashish Bhoya  on Medium</title>
            <link>https://medium.com/@ashish.bhoya.56?source=rss-b8a3872cc733------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:49:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashish.bhoya.56/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding JVM, JRE, and JDK: The Essentials of Java Development and Execution]]></title>
            <link>https://medium.com/@ashish.bhoya.56/understanding-jvm-jre-and-jdk-the-essentials-of-java-development-and-execution-52e5c788a155?source=rss-b8a3872cc733------2</link>
            <guid isPermaLink="false">https://medium.com/p/52e5c788a155</guid>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[jdk]]></category>
            <category><![CDATA[jre]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Ashish Bhoya ]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 08:37:05 GMT</pubDate>
            <atom:updated>2024-09-15T08:38:31.204Z</atom:updated>
            <content:encoded><![CDATA[<p>When you develop and run Java applications, various components come together in a structured way to transform human-readable code into an executable program. In this article, we’ll break down the key concepts behind Java’s development and execution process, focusing on the JDK, JRE, JVM, and other critical components like the JIT compiler and bytecode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dFv4VYBNSUdq9B-QqCFaHg.png" /></figure><h3>Key Definitions</h3><p>Before diving into the process, it’s essential to understand the relationships between the major components:</p><ul><li><strong>JDK (Java Development Kit)</strong> = JRE + Development Tools</li><li><strong>JRE (Java Runtime Environment)</strong> = JVM + Libraries</li><li><strong>JVM (Java Virtual Machine)</strong> = The environment where bytecode runs</li></ul><p>Let’s walk through how these fit together during the development and execution of a Java program.</p><h3>1. Writing the Java Code</h3><p>The journey starts with writing Java code. Java programs are written as plain text and saved with a .java file extension.</p><ul><li>Example: MyProgram.java</li></ul><h3>2. Java Development Kit (JDK)</h3><p>The <strong>JDK</strong> provides everything required to build Java applications. It contains:</p><ul><li><strong>Java Compiler (</strong><strong>javac)</strong>: Transforms Java code into bytecode.</li><li><strong>Java Runtime Environment (JRE)</strong>: Runs the compiled program.</li><li>Additional tools for debugging, documentation, and packaging.</li></ul><p>The JDK is vital for writing and compiling code, but it isn’t needed solely for running Java programs.</p><h3>3. Compilation</h3><p>Once the code is written, the Java compiler (javac) converts it into <strong>bytecode</strong>—a platform-independent intermediate format. This bytecode is stored in .class files.</p><ul><li><strong>Bytecode</strong>: A universal format that can run on any platform with a JVM.</li><li><strong>Class File</strong>: The compiled bytecode saved in a .class file, such as MyProgram.class.</li></ul><h3>4. Java Runtime Environment (JRE)</h3><p>The <strong>JRE</strong> is necessary for executing Java bytecode. It includes the JVM and essential libraries.</p><ul><li><strong>JVM</strong>: Executes or compiles bytecode at runtime.</li><li><strong>Libraries</strong>: Java’s standard libraries that support execution.</li></ul><p>For someone who only needs to run a Java program, the JRE is enough — they don’t need the full JDK.</p><h3>5. Java Virtual Machine (JVM)</h3><p>The <strong>JVM</strong> is the core part of the Java execution process. It reads bytecode and translates it into machine-specific instructions, enabling cross-platform compatibility. JVMs vary by platform (Windows, macOS, Linux), but they all interpret Java bytecode the same way.</p><p>The JVM performs two main tasks:</p><ol><li><strong>Interpreting Bytecode</strong>: Executes bytecode line by line.</li><li><strong>Just-In-Time (JIT) Compilation</strong>: Optimizes performance by converting frequently executed bytecode into native machine code.</li></ol><h3>6. Just-In-Time (JIT) Compiler</h3><p>The <strong>JIT compiler</strong> enhances execution by translating bytecode into <strong>machine code</strong> on the fly. This occurs when specific parts of the code are executed repeatedly, improving performance.</p><ul><li><strong>Machine Code</strong>: Platform-dependent code that the CPU directly executes.</li></ul><h3>7. Execution Flow</h3><p>Here’s a summarized flow of the entire process:</p><ol><li><strong>Write Java Code</strong>: You create a .java file with human-readable Java code.</li><li><strong>Compile the Code</strong>: The Java compiler (javac) converts the .java file into bytecode, generating a .class file.</li><li><strong>JVM Loads Bytecode</strong>: The JVM loads the bytecode stored in the .class file.</li><li><strong>JIT Compilation and Interpretation</strong>: The JVM either interprets or compiles the bytecode into machine code.</li><li><strong>Execution</strong>: The machine code runs on the CPU, executing the program.</li></ol><h3>Breaking Down the Core Components</h3><h3>Java Development Kit (JDK)</h3><p>The JDK is a full toolkit for Java developers, containing the compiler, JRE, and additional development tools. It is essential for writing and building Java applications.</p><h3>Java Virtual Machine (JVM)</h3><p>The JVM ensures Java’s platform independence. It interprets or compiles bytecode, manages memory, and optimizes performance through JIT compilation.</p><h3>Java Runtime Environment (JRE)</h3><p>The JRE includes everything needed to run Java applications — primarily the JVM and essential libraries. End-users typically need to install the JRE to run Java applications.</p><h3>Conclusion</h3><p>Java’s “Write Once, Run Anywhere” philosophy is possible due to the seamless interaction between the JDK, JVM, and JRE. The JDK allows developers to write and compile Java code, the JVM ensures platform independence, and the JRE provides a runtime environment. Understanding how these components work together can enhance your grasp of Java’s powerful, cross-platform capabilities.</p><p>NOTE — <em>This article has some content that has been used from Chat GPT</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52e5c788a155" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>