Home > Java > javaTutorial > What Java Version Corresponds to a Specific Class File's Major Version Number?

What Java Version Corresponds to a Specific Class File's Major Version Number?

DDD
Release: 2024-12-20 10:28:09
Original
811 people have browsed it

What Java Version Corresponds to a Specific Class File's Major Version Number?

Version Numbers of Java Class File Format

In the Java Virtual Machine, class files are assigned a major version number that indicates compatibility with a specific version of the Java platform. A list of major version numbers and their corresponding Java versions is provided in a table.

Java Version Major Version
23 67
22 66
21 65
20 64
19 63
18 62
17 61
16 60
15 59
14 58
13 57
12 56
11 55
10 54
9 53
8 52
7 51
6 50
5 49
1.4 48
1.3 47
1.2 46
1.1 45
1.0.2 45

Source of the List

The list of major version numbers is derived from the class version, found at byte offset 7 in the class file format. If you attempt to load a class that was compiled for a higher Java version into a runtime with a lower Java version, you will encounter an error indicating an incompatible class version.

Minor Versions

Minor versions are also assigned to class files, but they are not as significant as major versions and typically do not affect compatibility. Minor versions are used to indicate incremental updates within a major version.

For more detailed information, please refer to the following resources:

  • [Byte Offset 7 in Class File Format](https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.1)
  • [Historical Evolution of the Java Virtual Machine](https://docs.oracle.com/javase/8/docs/specs/jvms/jvms-history.html)

The above is the detailed content of What Java Version Corresponds to a Specific Class File's Major Version Number?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template