Java class loading mechanism

Source: Internet
Author: User

Table    of Contents 1. Overview    2. Simple procedure    3. Class loader each searches for directory    4. Class Loader features    5. Class loader get    6. Load of Class

1. Overview

Class loading is the first step in a Java program, and studying the loading of classes can help you understand the JVM execution process and instruct developers to take more effective steps to match the program execution. The second purpose of the research class loading mechanism is to enable the program to dynamically control class loading, such as thermal deployment, to improve the flexibility and adaptability of the program.

2. Simple process
When executing the command ' Java Hello ' at the command line, the JVM loads the ' hello.class ' file into memory and produces a ' class ' object ' Hello.class ', which is the process ' loading process ':
2.1 First find the ' Jvm.dll ' in the JRE directory, my machine is ' <jdk installation Path>\jre\bin\server\jvm.dll ', and initialize the JVM;
2.2 Generate a bootstrap Loader (launcher loader);
2.3 Bootstrap Loader automatically loads extended Loader (Standard extension class loader) and sets Bootstrap Loader to its parent Loader.
2.4 Bootstrap Loader automatically loads Appclass Loader (System ClassLoader) and sets extended Loader to its parent Loader.
2.5 Finally the HelloWorld class is loaded by Appclass loader.
The above is the general process of loading Java classes.

Java class loading mechanism

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.