Monday, August 8, 2022
ALTERNATIVE WAY
  • Home
  • Latest
  • News
  • World Tech
  • World Gaming
  • Guides
  • About The Team
  • Privacy Policy
  • Terms of Use
  • Contact Us
No Result
View All Result
  • Home
  • Latest
  • News
  • World Tech
  • World Gaming
  • Guides
  • About The Team
  • Privacy Policy
  • Terms of Use
  • Contact Us
No Result
View All Result
ALTERNATIVE WAY
No Result
View All Result

What is JRE | Java API, Class Loader

Gordon James by Gordon James
October 3, 2021
in World Tech Code
0 0
0
Home World Tech Code

In the previous tutorial, we knew that the three main components of the Java platform are the Java Virtual Machine (JVM), the Java Runtime Environment (JRE) and the Java Development Kit (JDK).

The Java Runtime Engine (JRE) is the software environment in which a Java program runs.

In other words: JRE is a software environment required to run Java applications on any system, regardless of the underlying operating system and hardware.

The JRE is part of the Java Development Kit, but it cannot be used alone to execute the bytecode (the compiled Java program). It cannot be used to develop programs for Java applications, but can be used to run them.

The Java Runtime Environment is a collection of programs that contains the Java Virtual Machine and many of the class library files needed to run programs on the JVM (using the java command).

If you have a modern JDK (Java Development Kit) installed on your computer system, you do not need to reinstall it.

The Java Development Kit also includes the Java Runtime Environment (JRE), which allows you to run Java programs in Eclipse on your system.

Java Runtime Environment (JRE) components

The JRE consists of the following main elements:

  • Java API (Application Programming Interface)
  • Nice forklift.
  • Bytecode checker
  • Java virtual machine (interpreter)

Look at the diagram below to understand the components of the JRE.

Let’s give a short description of each JRE component.

What is a Java API (Application Interface Programming)?

The Java Application Programming Interface (API) is a very large collection of standard software components that provide the core functionality of the Java programming language.

Simply put, a Java API is a large collection of classes, interfaces, and methods already defined as Java packages.

It offers programmers many useful features, such as a graphical user interface (GUI), date, time and calendar.

The Java API is grouped into libraries of related classes and interfaces and their fields, constructors, and methods. These libraries are offered as packages.

It provides additional programming capabilities based on the Java kernel platform. This means that the basic characteristics of the Java programming language do not change when a new version is released.

Since the Java API is flexible, it can be opened up to add new packages or libraries.

Here are some popular libraries and their functionality of the Java API, in brief:

(a) Java.lang : It is a package that provides basic classes for designing the Java programming language. The Java.lang package is dynamically imported (i.e. loaded) into the Java program. There is no need to enter it explicitly.

The most commonly used classes in the Java.lang package are Double, Float, Integer, String, StringBuffer, System, and Math.

(b) Java.io: Support for I/O via file system, keyboard, network, etc. The java.io package contains several classes to perform input and output operations.

The most commonly used classes in java.io are the File class, InputStreams, OutputStreams, Readers, Writers, and RandomAccessFile.

(c) Java.util : Supports various programming tools. The java.util package provides inherited collection classes, an event model, a collection framework, date and time functions, and other utilities such as the string tokenizer.

(d) Java. Math: Used to support arithmetic operations.

(e) Java.security : Supports security features.

(f) Java.awt : Allows you to create graphical user interfaces (GUIs), draw pictures and charts.

g) Java.sql : Supports accessing relational databases via SQL.

(h) Java. Beans: It supports the creation of Java Beans.

(i) Java.net : The java.net package contains classes that can be used to implement networking in Java programs.

j) Java.imageIO : Support for image input/output.

These predefined Java APIs provide the programmer with a lot of basic functionality. The programmer needs to know these Java APIs. He needs to know how to use these Java APIs.

These are examples of some of the important libraries in the Java API. We’ll talk more about these libraries in the next tutorial.

For a complete list of Java API classes, see the Oracle Web site: https://docs.oracle.com/javase/7/docs/api/.

What is a class loader in Java?

When we write a program in Java, the class loader places the program in memory before it can be executed.

The Java Class Loader takes a .class file that contains bytecode and transfers it to memory. It downloads the .class file from your system’s hard drive or over the network.

Once the class is loaded, it is passed to the bytecode checker.

There are essentially three subcomponents of a class loader in Java. They are as follows:

  1. Bootstrap class loader
  2. Charger class expansion
  3. System class charger

a) Bootstrap class loader :

The bootloader loads the main Java libraries located in C:Program FilesJavajre1.8.0_181lib. The contents of this directory in a JRE8 environment are shown in the following figure.

You can clearly see different *.jar files, such as charsets.jar, deployment.jar, javaws.jar, plugin.jar, etc.

b) Charger extension class :

The extension’s class loader loads classes from the extension directory C:Program FilesJavajre1.8.0_181libext. The following screenshot shows the contents of the Extensions directory in a JRE8 environment.

As you can see in the screenshot above, there are several JAR files available: access-bridge-64.jar, localedata.jar, etc. You can also see how it goes to the location above the path.

(c) Charger system class :

The System Class Loader loads the code from the location specified in the CLASSPATH environment variable set by the operating system, as shown in the following figure.

It can be found in Windows 10 under Control Panel ⇒ System and Security ⇒ System, Advanced System Settings ⇒ Advanced Tabs ⇒
Environment Variables.

What is a bytecode checker?

The bytecode checker checks whether the bytecodes are valid or not, without violating any of Java’s security rules. Particular attention is paid to checking the type of all variables and expressions in the code.

The bytecode checker ensures that no unauthorized access to the memory is possible. After successful verification, the code is passed to the Java Virtual Machine (JVM) for interpretation.

Message: We can choose to disable bytecode checking (which allows for slightly faster execution), enable it only for code loaded remotely from the network, or enable it for all code.

We hope this tutorial has covered all the basic concepts related to the Java Runtime Environment (JRE) and its main components. I hope you understood the basics of JRE.

In the next lesson, we will learn about the Java Virtual Machine (JVM).
Thanks for reading!!!

frequently asked questions

What is a class loader in the JVM?

Class loaders are responsible for dynamically loading Java classes into the JVM (Java Virtual Machine) at runtime. They are also part of the JRE (Java Runtime Environment). Thus, with class loaders, the JVM does not need to know anything about the underlying files or file systems to execute Java programs.

What is dynamic class loading in Java?

Dynamic class loading allows Java code to be loaded that is not known before the program is executed. The Java model loads classes as needed and does not need to know the names of all the classes in the collection before any of the classes are loaded and executed. … You can create an object at runtime by dynamically loading classes.

What is a load class in C#?

The class loader is responsible for loading the class after checking the metadata. … The class is loaded for execution only if the resources are available on the client computer and the version and security token of the DLL match the metadata.

Related Tags:

java class loader example,java load class at runtime,java class loader hierarchy,types of class loader in java,java create new class loader,java dynamic class loading from jar,Feedback,Privacy settings,How Search works,class loader error in java,which of the following statements about java class loader is true

Total
0
Shares
Share 0
Tweet 0
Pin it 0
Share 0
ShareTweetShare
Gordon James

Gordon James

Next Post

How to Reset Google Pixelbook Go Chromebook to Factory Settings

  • Trending
  • Comments
  • Latest
How To Get Free Internet On Android Without Service

How To Get Free Internet On Android Without Service

March 10, 2022

🥇 +4 Neo Geo Emulators for Android  List ▷ 2021

October 3, 2021

Fix: Notifications not working on Nova Launcher

October 3, 2021

How to Fix OpenVPN Connected but Not Changing IP Address

October 3, 2021

Setting Up Directory Sync Between On-Premises Active Directory with Microsoft 365 Azure AD

0

🥇 DELETE ACCOUNT from PS4  ▷ Step by Step Guide ▷ 2020

0

🥇 PPTX File Extension  What is .Pptx and how to open them? ▷ 2020

0

🥇 Make a Crossword in Microsoft Word  Step by Step Guide ▷ 2020

0
Social Media App

Social Media App

August 4, 2022

7 Best Online Games to Brain Train Yourself

August 2, 2022

The Main purpose of Travis Scott Shoes

August 1, 2022

How to Use Throwables in PUBGM + More

August 8, 2022

There's always an alternative Way!
No Result
View All Result
  • Home
  • Latest
  • News
  • World Tech
  • World Gaming
  • Guides
  • About The Team
  • Privacy Policy
  • Terms of Use
  • Contact Us

© 2022 - Alternative Way

No Result
View All Result
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
  • Travel News

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT