JDK 24 · 2025-03-18
JDK 24:Security Manager 退场
Security Manager 被永久禁用,Windows 32-bit x86 端口移除,ZGC 非分代模式移除;虚拟线程在 synchronized 中不再 pinning,Stream Gatherers 与 Class-File API 转正。
24官方 JEP 数
3正式特性
0预览 / 孵化
3移除 / 弃用
代表特性HIGHLIGHTS
这些是这一版最值得记住的变化。状态标签区分「正式 / 预览 / 孵化 / 移除」——预览不等于稳定,迁移时要特别确认。
全部 JEP24
数据来自 OpenJDK 官方 Features 表。中文名称仅为主要特性的人工标注。
| JEP | 标题 | 状态 | 来源 |
|---|---|---|---|
| JEP 404 | Generational Shenandoah (Experimental) | — | 官方 → |
| JEP 450 | Compact Object Headers (Experimental) 紧凑对象头(实验) | 实验 | 官方 → |
| JEP 472 | Prepare to Restrict the Use of JNI | — | 官方 → |
| JEP 475 | Late Barrier Expansion for G1 | — | 官方 → |
| JEP 478 | Key Derivation Function API (Preview) | — | 官方 → |
| JEP 479 | Remove the Windows 32-bit x86 Port | — | 官方 → |
| JEP 483 | Ahead-of-Time Class Loading & Linking | — | 官方 → |
| JEP 484 | Class-File API Class-File API 转正 | 正式 | 官方 → |
| JEP 485 | Stream Gatherers Stream Gatherers 转正 | 正式 | 官方 → |
| JEP 486 | Permanently Disable the Security Manager 永久禁用 Security Manager | 移除 | 官方 → |
| JEP 487 | Scoped Values (Fourth Preview) | — | 官方 → |
| JEP 488 | Primitive Types in Patterns, instanceof, and switch (Second Preview) | — | 官方 → |
| JEP 489 | Vector API (Ninth Incubator) | — | 官方 → |
| JEP 490 | ZGC: Remove the Non-Generational Mode ZGC 移除非分代模式 | 移除 | 官方 → |
| JEP 491 | Synchronize Virtual Threads without Pinning 虚拟线程去 pinning | 正式 | 官方 → |
| JEP 492 | Flexible Constructor Bodies (Third Preview) | — | 官方 → |
| JEP 493 | Linking Run-Time Images without JMODs | — | 官方 → |
| JEP 494 | Module Import Declarations (Second Preview) | — | 官方 → |
| JEP 495 | Simple Source Files and Instance Main Methods (Fourth Preview) | — | 官方 → |
| JEP 496 | Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism | — | 官方 → |
| JEP 497 | Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm | — | 官方 → |
| JEP 498 | Warn upon Use of Memory-Access Methods in sun.misc.Unsafe | — | 官方 → |
| JEP 499 | Structured Concurrency (Fourth Preview) | — | 官方 → |
| JEP 501 | Deprecate the 32-bit x86 Port for Removal | — | 官方 → |
移除与弃用REMOVED
升级前先排查这些变化。移除项通常不会在编译期全部报错,运行时或工具链上才暴露。
- Security Manager(JEP 486)
- Windows 32-bit x86 端口(JEP 479)
- ZGC 非分代模式(JEP 490)
这一版的故事STORY
Java 24 是一次大规模清理:Security Manager 正式退场,32 位 x86 端口移除,ZGC 只保留分代模式;同时虚拟线程去 pinning 让 synchronized 不再是雷区。
怎么用这一页:先读故事建立坐标,再扫一遍代表特性。如果你正在用这个版本,重点看「移除与弃用」;如果你在选型或面试,重点记住 2–3 个代表特性及其版本边界。