Java Bytecode Version: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Java Bytecode =Overview= =Playground=") |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[Java_Bytecode# | * [[Java_Bytecode#Java_Bytecode_Version|Java Bytecode]] | ||
* [[Gradle_Java_Plugin#Use_a_Specific_Java_Version|Specifying a bytecode version in Gradle]] | |||
=Overview= | =Overview= | ||
A valid class file starts with <code>0xcafebabe</code>, followed by the minor version as unsigned short, followed by the major version, as unsigned short. | |||
{|class="wikitable" style="text-align: left;" | |||
! 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= | =Playground= | ||
The following project produces a bytecode-version.jar that reads the bytecode version from a Java class: | |||
{{External|https://github.com/ovidiuf/playground/tree/master/java/bytecode/bytecode-version/README.md}} |
Latest revision as of 19:14, 12 June 2021
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: