Java Bytecode Version

From NovaOrdis Knowledge Base
Revision as of 19:14, 12 June 2021 by Ovidiu (talk | contribs) (→‎Internal)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

A valid class file starts with 0xcafebabe, followed by the minor version as unsigned short, followed by the major version, as unsigned short.

Java Version Bytecode Version
1.0 45.0
1.1 45.3
1.2 46.0
1.3 47.0
1.4 48.0
5 49.0
6 50.0
7 51.0
8 52.0
9 53.0
10 54.0
11 55.0
12 56.0
13 57.0
14 58.0
15 59.0
16 60.0
17 61.0

Playground

The following project produces a bytecode-version.jar that reads the bytecode version from a Java class:

https://github.com/ovidiuf/playground/tree/master/java/bytecode/bytecode-version/README.md