JVM Knowledge

The Java Virtual Machine is the cornerstone of the Java platform. It is the component of the technology responsible for its hardware- and operating system-independence, the small size of its compiled code, and its ability to protect users from malicious programs.

The Java Virtual Machine is an abstract computing machine. Like a real computing machine, it has an instruction set and manipulates various memory areas at run time. It is reasonably common to implement a programming language using a virtual machine; the best-known virtual machine may be the P-Code machine of UCSD Pascal.

The first prototype implementation of the Java Virtual Machine, done at Sun Microsystems, Inc., emulated the Java Virtual Machine instruction set in software hosted by a handheld device that resembled a contemporary Personal Digital Assistant (PDA). Oracle's current implementations emulate the Java Virtual Machine on mobile, desktop and server devices, but the Java Virtual Machine does not assume any particular implementation technology, host hardware, or host operating system. It is not inherently interpreted, but can just as well be implemented by compiling its instruction set to that of a silicon CPU. It may also be implemented in microcode or directly in silicon.

The Java Virtual Machine knows nothing of the Java programming language, only of a particular binary format, the class file format. A class file contains Java Virtual Machine instructions (or bytecodes) and a symbol table, as well as other ancillary information.

For the sake of security, the Java Virtual Machine imposes strong syntactic and structural constraints on the code in a class file. However, any language with functionality that can be expressed in terms of a valid class file can be hosted by the Java Virtual Machine. Attracted by a generally available, machine-independent platform, implementors of other languages can turn to the Java Virtual Machine as a delivery vehicle for their languages.

The class file format is versioned: every class file declares a version number, of the form major.minor, which indicates the file's dependency on a particular release of Java SE, and influences the interpretation of the file by the Java Virtual Machine.

The Java Virtual Machine specified here is compatible with Java SE 26, and supports the Java programming language specified in The Java Language Specification, Java SE 26 Edition. It supports class files with major version numbers 45 through 70, inclusive.

Tools that generate class files will typically adopt the latest major version number in order to take advantage of the latest features; but a class file with an older major version number can generally expect to be supported in future Java Virtual Machine releases.

For reference, the following table shows the class file major version numbers supported by each release of Java SE, up to Java SE 26. The third column, "Earliest", shows the earliest class file major version number supported by the Java Virtual Machine in that release. The fourth column, "Latest", shows the latest class file major version number supported by the Java Virtual Machine in that release. (For very early releases, the JDK version is shown instead of the Java SE release.)

Table 1.2-A. Java SE releases & class file major versions

Java SE Released Earliest Latest
1.0.2 May 1996 45 45
1.1 February 1997 45 45
1.2 December 1998 45 46
1.3 May 2000 45 47
1.4 February 2002 45 48
5.0 September 2004 45 49
6 December 2006 45 50
7 July 2011 45 51
8 March 2014 45 52
9 September 2017 45 53
10 March 2018 45 54
11 September 2018 45 55
12 March 2019 45 56
13 September 2019 45 57
14 March 2020 45 58
15 September 2020 45 59
16 March 2021 45 60
17 September 2021 45 61
18 March 2022 45 62
19 September 2022 45 63
20 March 2023 45 64
21 September 2023 45 65
22 March 2024 45 66
23 September 2024 45 67
24 March 2025 45 68
25 September 2025 45 69
26 March 2026 45 70