APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang.reflect

public final Enum ClassFileFormatVersion

extends Enum<ClassFileFormatVersion>
Class Inheritance
Annotations
@SuppressWarnings:doclint:reference

Class file format versions of the Java virtual machine. See the appropriate edition of The Java Virtual Machine Specification for information about a particular class file format version.

Note that additional class file format version constants will be added to model future releases of the Java Virtual Machine Specification.

API Note

The complete version used in a class file includes a major version and a minor version; this enum only models the major version. A Java virtual machine implementation is required to support a range of major versions; see the corresponding edition of the The Java Virtual Machine Specification for details.

Since
20
See Also
System property java.class.version, java.compiler/javax.lang.model.SourceVersion

Field Summary

Modifier and TypeField and Description
private final int
public static final ClassFileFormatVersion
RELEASE_0

The original version.

public static final ClassFileFormatVersion
RELEASE_1

The version recognized by the Java Platform 1.1.

public static final ClassFileFormatVersion
RELEASE_10

The version introduced by the Java Platform, Standard Edition 10.

public static final ClassFileFormatVersion
RELEASE_11

The version introduced by the Java Platform, Standard Edition 11.

public static final ClassFileFormatVersion
RELEASE_12

The version introduced by the Java Platform, Standard Edition 12.

public static final ClassFileFormatVersion
RELEASE_13

The version introduced by the Java Platform, Standard Edition 13.

public static final ClassFileFormatVersion
RELEASE_14

The version introduced by the Java Platform, Standard Edition 14.

public static final ClassFileFormatVersion
RELEASE_15

The version introduced by the Java Platform, Standard Edition 15.

public static final ClassFileFormatVersion
RELEASE_16

The version introduced by the Java Platform, Standard Edition 16.

public static final ClassFileFormatVersion
RELEASE_17

The version introduced by the Java Platform, Standard Edition 17.

public static final ClassFileFormatVersion
RELEASE_18

The version introduced by the Java Platform, Standard Edition 18.

public static final ClassFileFormatVersion
RELEASE_19

The version introduced by the Java Platform, Standard Edition 19.

public static final ClassFileFormatVersion
RELEASE_2

The version introduced by the Java 2 Platform, Standard Edition, v 1.2.

public static final ClassFileFormatVersion
RELEASE_20

The version introduced by the Java Platform, Standard Edition 20.

public static final ClassFileFormatVersion
RELEASE_21

The version introduced by the Java Platform, Standard Edition 21.

public static final ClassFileFormatVersion
RELEASE_22

The version introduced by the Java Platform, Standard Edition 22.

public static final ClassFileFormatVersion
RELEASE_23

The version introduced by the Java Platform, Standard Edition 23.

public static final ClassFileFormatVersion
RELEASE_24

The version introduced by the Java Platform, Standard Edition 24.

public static final ClassFileFormatVersion
RELEASE_25

The version introduced by the Java Platform, Standard Edition 25.

public static final ClassFileFormatVersion
RELEASE_26

The version introduced by the Java Platform, Standard Edition 26.

public static final ClassFileFormatVersion
RELEASE_27

The version introduced by the Java Platform, Standard Edition 27.

public static final ClassFileFormatVersion
RELEASE_3

The version introduced by the Java 2 Platform, Standard Edition, v 1.3.

public static final ClassFileFormatVersion
RELEASE_4

The version introduced by the Java 2 Platform, Standard Edition, v 1.4.

public static final ClassFileFormatVersion
RELEASE_5

The version introduced by the Java 2 Platform, Standard Edition 5.0.

public static final ClassFileFormatVersion
RELEASE_6

The version introduced by the Java Platform, Standard Edition 6.

public static final ClassFileFormatVersion
RELEASE_7

The version introduced by the Java Platform, Standard Edition 7.

public static final ClassFileFormatVersion
RELEASE_8

The version introduced by the Java Platform, Standard Edition 8.

public static final ClassFileFormatVersion
RELEASE_9

The version introduced by the Java Platform, Standard Edition 9.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ClassFileFormatVersion

Returns:

the latest class file format version whose major class file version matches the argument
fromMajor
(int
the major class file version as an integer
major
)

Returns the latest class file format version whose major class file version matches the argument.

public static ClassFileFormatVersion

Returns:

the latest class file format version
latest
()

Returns the latest class file format version.

public int

Returns:

the major class file version as an integer
major
()

Returns the major class file version as an integer.

public Runtime.Version

Returns:

the least runtime version that supports this class file format version; otherwise null
runtimeVersion
()

Returns the least runtime version that supports this class file format version; otherwise null.

public static ClassFileFormatVersion
public static ClassFileFormatVersion

Returns:

the latest class file format version that is usable under the runtime version argument
valueOf
(Runtime.Version
runtime version to map to a class file format version
rv
)

Returns the latest class file format version that is usable under the runtime version argument.

public static ClassFileFormatVersion[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

majorback to summary
private final int major
RELEASE_0back to summary
public static final ClassFileFormatVersion RELEASE_0

The original version. The format described in The Java Virtual Specification, First Edition.

RELEASE_1back to summary
public static final ClassFileFormatVersion RELEASE_1

The version recognized by the Java Platform 1.1.

API Note

While RELEASE_0 and RELEASE_1 have the same major version, several additional attributes were defined for RELEASE_1 (JVMS 4.7).

RELEASE_10back to summary
public static final ClassFileFormatVersion RELEASE_10

The version introduced by the Java Platform, Standard Edition 10.

See Also
The Java Virtual Machine Specification, Java SE 10 Edition
RELEASE_11back to summary
public static final ClassFileFormatVersion RELEASE_11

The version introduced by the Java Platform, Standard Edition 11.

See Also
The Java Virtual Machine Specification, Java SE 11 Edition, JEP 181: Nest-Based Access Control
RELEASE_12back to summary
public static final ClassFileFormatVersion RELEASE_12

The version introduced by the Java Platform, Standard Edition 12.

See Also
The Java Virtual Machine Specification, Java SE 12 Edition
RELEASE_13back to summary
public static final ClassFileFormatVersion RELEASE_13

The version introduced by the Java Platform, Standard Edition 13.

See Also
The Java Virtual Machine Specification, Java SE 13 Edition
RELEASE_14back to summary
public static final ClassFileFormatVersion RELEASE_14

The version introduced by the Java Platform, Standard Edition 14.

See Also
The Java Virtual Machine Specification, Java SE 14 Edition
RELEASE_15back to summary
public static final ClassFileFormatVersion RELEASE_15

The version introduced by the Java Platform, Standard Edition 15.

See Also
The Java Virtual Machine Specification, Java SE 15 Edition, JEP 371: Hidden Classes
RELEASE_16back to summary
public static final ClassFileFormatVersion RELEASE_16

The version introduced by the Java Platform, Standard Edition 16.

See Also
The Java Virtual Machine Specification, Java SE 16 Edition
RELEASE_17back to summary
public static final ClassFileFormatVersion RELEASE_17

The version introduced by the Java Platform, Standard Edition 17. Additions in this release include sealed classes and restoration of always-strict floating-point semantics.

See Also
The Java Virtual Machine Specification, Java SE 17 Edition, JEP 306: Restore Always-Strict Floating-Point Semantics, JEP 409: Sealed Classes
RELEASE_18back to summary
public static final ClassFileFormatVersion RELEASE_18

The version introduced by the Java Platform, Standard Edition 18.

See Also
The Java Virtual Machine Specification, Java SE 18 Edition
RELEASE_19back to summary
public static final ClassFileFormatVersion RELEASE_19

The version introduced by the Java Platform, Standard Edition 19.

See Also
The Java Virtual Machine Specification, Java SE 19 Edition
RELEASE_2back to summary
public static final ClassFileFormatVersion RELEASE_2

The version introduced by the Java 2 Platform, Standard Edition, v 1.2. The format described in The Java Virtual Machine Specification, Second Edition, which includes the ACC_STRICT access flag.

RELEASE_20back to summary
public static final ClassFileFormatVersion RELEASE_20

The version introduced by the Java Platform, Standard Edition 20.

See Also
The Java Virtual Machine Specification, Java SE 20 Edition
RELEASE_21back to summary
public static final ClassFileFormatVersion RELEASE_21

The version introduced by the Java Platform, Standard Edition 21.

Since
21
See Also
The Java Virtual Machine Specification, Java SE 21 Edition
RELEASE_22back to summary
public static final ClassFileFormatVersion RELEASE_22

The version introduced by the Java Platform, Standard Edition 22.

Since
22
See Also
The Java Virtual Machine Specification, Java SE 22 Edition
RELEASE_23back to summary
public static final ClassFileFormatVersion RELEASE_23

The version introduced by the Java Platform, Standard Edition 23.

Since
23
See Also
The Java Virtual Machine Specification, Java SE 23 Edition
RELEASE_24back to summary
public static final ClassFileFormatVersion RELEASE_24

The version introduced by the Java Platform, Standard Edition 24.

Since
24
See Also
The Java Virtual Machine Specification, Java SE 24 Edition
RELEASE_25back to summary
public static final ClassFileFormatVersion RELEASE_25

The version introduced by the Java Platform, Standard Edition 25.

Since
25
See Also
The Java Virtual Machine Specification, Java SE 25 Edition
RELEASE_26back to summary
public static final ClassFileFormatVersion RELEASE_26

The version introduced by the Java Platform, Standard Edition 26.

Since
26
See Also
The Java Virtual Machine Specification, Java SE 26 Edition
RELEASE_27back to summary
public static final ClassFileFormatVersion RELEASE_27

The version introduced by the Java Platform, Standard Edition 27.

Since
27
See Also
The Java Virtual Machine Specification, Java SE 27 Edition
RELEASE_3back to summary
public static final ClassFileFormatVersion RELEASE_3

The version introduced by the Java 2 Platform, Standard Edition, v 1.3.

RELEASE_4back to summary
public static final ClassFileFormatVersion RELEASE_4

The version introduced by the Java 2 Platform, Standard Edition, v 1.4.

RELEASE_5back to summary
public static final ClassFileFormatVersion RELEASE_5

The version introduced by the Java 2 Platform, Standard Edition 5.0.

See Also
The Java Virtual Machine Specification, Second Edition updated for Java SE 5.0, JSR 14: Add Generic Types To The Java™ Programming Language, JSR 175: A Metadata Facility for the Java™ Programming Language
RELEASE_6back to summary
public static final ClassFileFormatVersion RELEASE_6

The version introduced by the Java Platform, Standard Edition 6.

See Also
The Java Virtual Machine Specification, Java SE, Second Edition updated for Java SE 6
RELEASE_7back to summary
public static final ClassFileFormatVersion RELEASE_7

The version introduced by the Java Platform, Standard Edition 7.

See Also
The Java Virtual Machine Specification, Java SE 7 Edition
RELEASE_8back to summary
public static final ClassFileFormatVersion RELEASE_8

The version introduced by the Java Platform, Standard Edition 8.

See Also
The Java Virtual Machine Specification, Java SE 8 Edition, JSR 335: Lambda Expressions for the Java™ Programming Language
RELEASE_9back to summary
public static final ClassFileFormatVersion RELEASE_9

The version introduced by the Java Platform, Standard Edition 9.

See Also
The Java Virtual Machine Specification, Java SE 9 Edition, JSR 376: Java™ Platform Module System

Constructor Detail

ClassFileFormatVersionback to summary
private ClassFileFormatVersion(int major)

Method Detail

fromMajorback to summary
public static ClassFileFormatVersion fromMajor(int major)

Returns the latest class file format version whose major class file version matches the argument.

Parameters
major:int

the major class file version as an integer

Returns:ClassFileFormatVersion

the latest class file format version whose major class file version matches the argument

Exceptions
IllegalArgumentException:
if the argument is outside of the range of major class file versions
latestback to summary
public static ClassFileFormatVersion latest()

Returns the latest class file format version.

Returns:ClassFileFormatVersion

the latest class file format version

majorback to summary
public int major()

Returns the major class file version as an integer.

Returns:int

the major class file version as an integer

Java Virtual Machine Specification
4.1 The ClassFile Structure
runtimeVersionback to summary
public Runtime.Version runtimeVersion()

Returns the least runtime version that supports this class file format version; otherwise null. The returned runtime version has a feature large enough to support this class file format version and has no other elements set. Class file format versions greater than or equal to RELEASE_6 have non-null results.

Returns:Runtime.Version

the least runtime version that supports this class file format version; otherwise null

valueOfback to summary
public static ClassFileFormatVersion valueOf(String name)
valueOfback to summary
public static ClassFileFormatVersion valueOf(Runtime.Version rv)

Returns the latest class file format version that is usable under the runtime version argument. If the runtime version's feature is greater than the feature of the runtime version of the latest class file format version, an IllegalArgumentException is thrown.

Because the class file format versions of the Java platform have so far followed a linear progression, only the feature component of a runtime version is queried to determine the mapping to a class file format version. If that linearity changes in the future, other components of the runtime version may influence the result.

API Note

An expression to convert from a string value, for example "17", to the corresponding class file format version, RELEASE_17, is:

ClassFileFormatVersion.valueOf(Runtime.Version.parse("17"))
ClassFileFormatVersion.valueOf(Runtime.Version.parse("17"))
Parameters
rv:Runtime.Version

runtime version to map to a class file format version

Returns:ClassFileFormatVersion

the latest class file format version that is usable under the runtime version argument

Exceptions
NullPointerException:
if rv is null
IllegalArgumentException:
if the feature of version argument is greater than the feature of the platform version.
valuesback to summary
public static ClassFileFormatVersion[] values()