Skip to content

Support class file version 70 (Java 26) - #4

Merged
wasabii merged 1 commit into
mainfrom
support-class-version-70
Jul 18, 2026
Merged

Support class file version 70 (Java 26)#4
wasabii merged 1 commit into
mainfrom
support-class-version-70

Conversation

@wasabii

@wasabii wasabii commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Closes #1.

Summary

Java 26 reached GA on 2026-03-17 with class file major version 70. This adds support for it — building on the Latest-driven guard introduced in #2. Together with #2 (through Java 25) this brings the library current with every released JVM, resolving #1.

Spec check (JVMS SE 26 §4)

Answering the question raised in #1 ("any major changes between 63 and 70, or just a constant bump?"): I pulled the Java SE 26 class file spec and verified the format is structurally identical to version 61 (Java 17) — no new structures were added between 63 and 70:

Surface Java SE 26 In library
Constant pool tags 17 (last added: Dynamic, v55) ✅ all present
Predefined attributes 30 (last added: PermittedSubclasses, v61 / Java 17) ✅ all present
Class/field/method access flags unchanged
major_version accepted range 45–70 inclusive ✅ after this change

The spec is explicit: "The major_version item must be a value in the range 45 through 70, inclusive. A Java Virtual Machine implementation which conforms to Java SE 26 supports precisely these major version numbers."

(Note: Record and PermittedSubclasses, mentioned in the issue thread, were already implemented — they landed in v60/v61, at or below the old cap of 63. So for 63→70 specifically, this is indeed just the version constant.)

Change

  • Add ClassFormatVersion.Java26 = new(70, 0).
  • Advance ClassFormatVersion.Latest to Java26.

The decoder guards (TryMeasure/TryRead) already compare against ClassFormatVersion.Latest.Major (from #2), so the accepted-version cap rises to 70 automatically — no ClassFile.cs change needed. Builds clean (0 errors).

Out of scope: preview / Valhalla

The value-class work does introduce real format changes (a LoadableDescriptors attribute; ACC_STRICT reused as a field flag), but these live in the separate preview spec supplement and only appear in 70.65535 (preview-enabled) class files — not mainline version 70. Those class files still decode today (unknown attributes are preserved as UnknownAttribute); they would only fail on re-encode. Implementing preview/Valhalla structures can be a follow-up if/when desired.

🤖 Generated with Claude Code

Java 26 reached GA on 2026-03-17 with class file major version 70. Per
the JVMS SE 26 spec (section 4), the class file format is structurally
identical to version 61 (Java 17): no new constant pool tags, predefined
attributes, or access flags were added. The spec states major_version
must be in the range 45 through 70 inclusive for a Java SE 26 JVM.

Add the Java26 constant (70.0) and advance Latest to it. The decoder
guards already compare against ClassFormatVersion.Latest.Major, so this
raises the accepted version cap to 70 automatically.

Preview/Valhalla structures (e.g. the LoadableDescriptors attribute,
ACC_STRICT reused as a field flag) live in the separate preview spec
supplement and only appear in version 70.65535 class files; they remain
out of scope. Such class files still decode, with unknown attributes
preserved as UnknownAttribute.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wasabii
wasabii merged commit f2f5145 into main Jul 18, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support class file versions >63 (Java 19)

1 participant