JVM- JDK- JRE: The BACK END OF JAVA…

Let’s begin with the starters before entering the heavy main course…

Starting to explore with JVM (Java Virtual Machine)...

The Java Virtual Machine (JVM) executes programs by converting Java source code into Bytecode (a machine language). An environment for running Java source code is created by the Java Virtual Machine while staying completely on top of the host operating system. JVM enables Java's extremely useful characteristic of "Write once and execute anywhere."

Moving into JDK (Java Development Kit)...

The Java Development Kit is a software development environment that generates a run-time environment for the execution of Java source code.

Proceeding to JRE (Java Run-time Environment)...

All Java source codes are run on a platform known as the Java Run-time Environment. Software plugins, jar files, and support libraries required for the source code are all integrated by JRE.

A proper introduction with the bricks of the foundation:

Architecture of Java Virtual Machine

A computer may run Java applications as well as programs written in other languages that have already been translated into Java bytecode using a Java virtual machine, or JVM. JVM provides a setting for Java applications to run in while running as an application on top of an operating system.


You've probably heard that, in accordance with the Write Once Run Anywhere (WORA) principle, Java programs are platform-independent and may be written just once to run on any computer, regardless of the operating system or hardware. The Java Virtual Machine supports this idea.


Since the JVM is an abstract virtual machine, many different JVM implementations exist. Oracle Java uses Hotspot as its primary example of a Java Virtual Machine.

Exploring the insides of JVM:

Have you observed that following each compilation of a Java program, a file with the.class extension always appears? The bytecode that we previously indicated is present in this file. It needs to be loaded into the JVM in order to be executable. The bytecode will be converted into platform native code when JVM runs this program.


Basically, the way the JVM operates is as follows: first, it loads the bytecode from the. class extension file, then it checks to see if the bytecode is secure to prevent data corruption or unpredictable behaviour, after that, it executes the bytecode, and finally, it gives us the Java Runtime Environment (JRE), which we will learn about later in this article.

The JVM is made up of the following main parts:

  • Class Loader
  • Run-Time Data Areas
  • Execution Engine

Why do we need Java Development Kit?

Last but not least, JDK is a set of tools and environments for running and creating Java programs. It lets you develop, run, compile, and debug your programs.


JDK's fundamental elements consist of:

  • Development Tools
  • Java Runtime Environment

The following are a some of the elements that are part of JDK:

The Java Compiler is a javac utility that may be found in the JDK installation directory's /bin subdirectory. This utility will read and compile Java programming language class and interface definitions into byte code class files.

The Java Command opens the java runtime environment, starts the java application, loads the specified class, and then invokes the class main function. This is the java interpreter, which is used to interpret.class java files created by the java compiler. The methods that are declared here are static and public.

The Javap Command, a JDK disassembly tool that disassembles one or more class files, is used in the Java disassembler. If no option is selected or utilized, javap will print the package, public and protected fields, and methods of the classes that were supplied to it. The output will depend on the option selected.

Documentation for Java Using the Javadoc Tool, which is a component of the JDK, makes it easier to maintain the code.

Java Debugger for Java classes is a straightforward command-line tool.

Applet Viewer for Java It is used to view the applets, and to do this, you connect to the documents using the applet viewer command and display any applets that the document has already linked to in another document.

What does Java Runtime Environment do?

JRE is made up of a variety of additional supporting software tools and capabilities in addition to the Java Virtual Machine to help you get the most out of your Java applications.

Deployment approaches

Deployment technologies like Java Web Start and Java Plugin that make it easier to activate apps and offer cutting-edge support for upcoming Java versions are included as part of the JRE installation.

Toolkits for development

Moreover, the JRE includes toolkits made to assist developers in enhancing their user interface. These toolkits include, among others:
An Application Programming Interface (API) called Java 2D is used to create two-dimensional graphics in the Java programming language. Rich user interfaces, special effects, games, and animations can all be made by developers.
A GUI (Graphical User Interface) used to build objects, buttons, scroll bars, and windows are called the Abstract Window Toolkit (AWT).
Swing is a different lightweight GUI that offers adaptable, user-friendly adjustments by utilizing a wide variety of widgets.

Integration Libraries

Java Runtime Environment provides a number of integration libraries to assist developers in creating seamless data connections between their applications and services.

Some of these libraries include:

  • Java Cobra : Uses Common Object Request Architecture to support distributed objects written in Java programming language.
  • Java Database Connectivity (JDBC) API: Provides tools for developers to write applications with access to remote relationship databases, flat files, and spreadsheets.
  • Java Naming and Directory Interface (JNDI): A programming interface and directory service that lets clients create portable applications that can fetch information from databases using naming conventions.
Libraries for languages and utilities

The java.lang and java.util packages, which are essential for Java application design, package versioning, management, and monitoring, are included with the JRE.

These bundles include, among others:

  • Collections Framework: A unified framework made up of a number of interfaces intended to enhance application data processing and storage.
  • Concurrency Utilities: A robust framework package that includes threading tools with good performance.
  • Preferences API: A compact, cross-platform persistent API that enables many users to declare their own set of programme preferences on the same machine.
  • Logging: Generates log reports for further study, such as security lapses, configuration faults, and performance problems.
  • Java Archive(JAR): A platform-independent file format that allows numerous files to be combined into a single JAR file, greatly accelerating download times and shrinking file sizes.

THE THREE PILLARS OF JAVA

There are a few key things about JVM, JRE, and JDK that you should keep in mind:
JRE is required to run Java programmes and contains the JVM and standard libraries; JVM executes Java programmes that have been built.

JDK, which is required to create Java programs, comes with development tools and JRE which includes JVM in it.

CONCLUSION: Confluence Of JVM, JDK, JRE

The confluence of JVM, JDK and JRE makes JAVA a lot more advantageous.
  • Learning Java is simple. (JDK, JRE)
    Java was created with simplicity in mind, making it simpler to write, compile, debug, and learn than other programming languages.
  • Java is object-oriented.
    As a result, you can develop modular programs with reusable code.
  • Java is platform-independent. (JVM)
    Java's ease of transition between different computer systems is one of its most important features. World Wide Web software must be able to run identical programs on a variety of platforms, and Java excels at this by being platform-independent at both the source and binary levels.

Comments

Popular Posts