JDK,JRE & JVM

My understanding

Java Development Kit:

  • Jdk is toolset
  • Toolset means set of software
    • Error check(check the syntax)
    • Compiler(translate)
  • Compiler(javac) -change .java file to .class file
  • Source code –> Compile(javac)–>.class (Compile time)

Java virtual Machine:

  • Converting .class file(Byte Code) to Machine code(Binary Code)-(Run Time)
  • It does not physically exists

Java Runtime Environment:

  • Jre is run a java application
  • It’s implementation of JVM
  • Source code –> Compile(javac)–>.class(byte code) –>jre(jvm)–>binary code–>output

Just In Time

  • JIT is part of JVM
  • It’s compile machine code line by line
  • Jit is Interpreter

JDK: Java Development Kit

JDK is an acronym for Java Development Kit. 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.

JDK is an implementation of any one of the below given Java Platforms released by Oracle corporation:

  • Standard Edition Java Platform
  • Enterprise Edition Java Platform
  • Micro Edition Java Platform

The JDK contains a private Java Virtual Machine (JVM) and a few other resources such as an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) etc. to complete the development of a Java Application.

JRE: Java Runtime Environment

Java Runtime Environment (JRE) is an open-access software distribution that has a Java class library, specific tools, and a separate JVM. JRE is one of the interrelated components in the Java Development Kit (JDK). It is the most common environment available on devices for running Java programs. Java source code is compiled and converted to Java bytecode. If you want to run this bytecode on any platform, you need JRE. The JRE loads classes check memory access and get system resources. JRE acts as a software layer on top of the operating system.

Components of JRE:[TBD]

  • Integration libraries include Java Database Connectivity (JDBC)
  • Java Naming, Interface Definition Language (IDL)
  • Directory Interface (JNDI)
  • Remote Method Invocation Over Internet Inter-Orb Protocol (RMI-IIOP)
  • Remote Method Invocation (RMI)
  • Scripting

Working of JRE:[TBD]

Java Development Kit (JDK) and Java Runtime Environment (JRE)  both interact with each other to create a sustainable runtime environment that enables Java-based applications to run seamlessly on any operating system. The  JRE runtime architecture consists of the following elements as listed:

  1. ClassLoader
  2. ByteCode verifier
  3. Interpreter

Now let us brief about them as follows:

  • ClassLoader: Java ClassLoader dynamically loads all the classes necessary to run a Java program. Because classes are only loaded into memory whenever they are needed, the JRE uses ClassLoader will automate this process when needed.  
  • Bytecode Verifier: The bytecode checker ensures the format and precision of Java code before passing it to the interpreter. If the code violates system integrity or access rights, the class is considered corrupt and will not load.  
  • Interpreter: After loading the byte code successfully, the Java interpreter creates an object of the Java virtual machine that allows the Java program to run natively on the underlying machine.

JVM: Java Virtual Machine

Java Virtual Machine (JVM) is a engine that provides runtime environment to drive the Java Code or applications. It converts Java bytecode into machines language. JVM is a part of Java Runtime Environment (JRE). In other programming languages, the compiler produces machine code for a particular system. However, Java compiler produces code for a Virtual Machine known as Java Virtual Machine.

How JVM Works?

First, Java code is compiled into bytecode. This bytecode gets interpreted on different machines

Between host system and Java source, Bytecode is an intermediary language.

JVM in Java is responsible for allocating memory space.

JIT : Just In Time

The Just-In-Time (JIT) compiler is a component of the JRE (Java Runtime Environment) that improves the performance of Java applications at run time. It helps improve the performance of Java programs by compiling bytecodes into native machine code at runtime .

Reference

Leave a comment

Design a site like this with WordPress.com
Get started