JDK JDK 学习手册8 → 27 · JDK 专用学习站
JDK 24 · 2025-03-18

JDK 24:Security Manager 退场

Security Manager 被永久禁用,Windows 32-bit x86 端口移除,ZGC 非分代模式移除;虚拟线程在 synchronized 中不再 pinning,Stream Gatherers 与 Class-File API 转正。

发布 2025-03-18 class 文件版本 68 状态 版本档案 代表特性 6 项
24官方 JEP 数
3正式特性
0预览 / 孵化
3移除 / 弃用

代表特性HIGHLIGHTS

这些是这一版最值得记住的变化。状态标签区分「正式 / 预览 / 孵化 / 移除」——预览不等于稳定,迁移时要特别确认。

移除

永久禁用 Security Manager

相关 API 进入退役状态。

JEP 486

正式

虚拟线程去 pinning

synchronized 不再导致载体线程被固定。

JEP 491

正式

Stream Gatherers 转正

自定义 Stream 中间操作成为标准能力。

JEP 485

正式

Class-File API 转正

标准 API 读写 class 文件。

JEP 484

移除

ZGC 移除非分代模式

分代 ZGC 成为唯一模式。

JEP 490

实验

紧凑对象头(实验)

降低对象头开销,提升内存密度。

JEP 450

全部 JEP24

数据来自 OpenJDK 官方 Features 表。中文名称仅为主要特性的人工标注。

JEP标题状态来源
JEP 404Generational Shenandoah (Experimental)—官方 →
JEP 450Compact Object Headers (Experimental)
紧凑对象头(实验)
实验官方 →
JEP 472Prepare to Restrict the Use of JNI—官方 →
JEP 475Late Barrier Expansion for G1—官方 →
JEP 478Key Derivation Function API (Preview)—官方 →
JEP 479Remove the Windows 32-bit x86 Port—官方 →
JEP 483Ahead-of-Time Class Loading & Linking—官方 →
JEP 484Class-File API
Class-File API 转正
正式官方 →
JEP 485Stream Gatherers
Stream Gatherers 转正
正式官方 →
JEP 486Permanently Disable the Security Manager
永久禁用 Security Manager
移除官方 →
JEP 487Scoped Values (Fourth Preview)—官方 →
JEP 488Primitive Types in Patterns, instanceof, and switch (Second Preview)—官方 →
JEP 489Vector API (Ninth Incubator)—官方 →
JEP 490ZGC: Remove the Non-Generational Mode
ZGC 移除非分代模式
移除官方 →
JEP 491Synchronize Virtual Threads without Pinning
虚拟线程去 pinning
正式官方 →
JEP 492Flexible Constructor Bodies (Third Preview)—官方 →
JEP 493Linking Run-Time Images without JMODs—官方 →
JEP 494Module Import Declarations (Second Preview)—官方 →
JEP 495Simple Source Files and Instance Main Methods (Fourth Preview)—官方 →
JEP 496Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism—官方 →
JEP 497Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm—官方 →
JEP 498Warn upon Use of Memory-Access Methods in sun.misc.Unsafe—官方 →
JEP 499Structured Concurrency (Fourth Preview)—官方 →
JEP 501Deprecate 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 个代表特性及其版本边界。

JDK 学习手册 · JDK / Java 专用学习站 · 纯静态 · 双击 index.html 即可使用

本站专注 JDK 版本演进与 Java 教学,非 Oracle / OpenJDK 官方站点。版本数据来自 OpenJDK 官方 Features 表;课程示例已在对应本机 JDK 实测。构建日期 2026-11-12。