---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 27 Edition"
java_version: 27
chapter: "Chapter 12. Execution"
section: "12"
heading: "Chapter 12. Execution"
source: https://docs.oracle.com/javase/specs/jls/se27/html/jls-12.html
id: "12"
url: https://jvm.obfuscated.software/jls/se27/12.html
raw: https://jvm.obfuscated.software/jls/se27/12.md
---

# Chapter 12. Execution

This chapter specifies activities that occur during execution of a program. It is organized around the life cycle of the Java Virtual Machine and of the classes, interfaces, and objects that form a program.

The Java Virtual Machine starts up by loading a specified class or interface, then invoking a `main` method in this specified class or interface. Section [§12.1](12.1.md) outlines the loading, linking, and initialization steps involved in executing this method, as an introduction to the concepts in this chapter. Further sections specify the details of loading ([§12.2](12.2.md)), linking ([§12.3](12.3.md)), and initialization ([§12.4](12.4.md)).

The chapter continues with a specification of the procedures for creation of new class instances ([§12.5](12.5.md)); and finalization of class instances ([§12.6](12.6.md)). It concludes by describing the unloading of classes ([§12.7](12.7.md)) and the procedure followed when a program exits ([§12.8](12.8.md)).

**Sections:**

- [12.1. Java Virtual Machine Startup](12.1.md)
- [12.2. Loading of Classes and Interfaces](12.2.md)
- [12.3. Linking of Classes and Interfaces](12.3.md)
- [12.4. Initialization of Classes and Interfaces](12.4.md)
- [12.5. Creation of New Class Instances](12.5.md)
- [12.6. Finalization of Class Instances](12.6.md)
- [12.7. Unloading of Classes and Interfaces](12.7.md)
- [12.8. Program Exit](12.8.md)
