JDK 17

2021-9-14 发布

JDK17 是自 2018年 JDK11 后的第二个长期支持版本,支持到2029年9月,支持时间长达8年,这下可以不用死守 JDK8了,JDK 17+ 也可以是一种新的选择了。下一个第三个长期支持版本是 JDK21,时间为 2023年9月,这次长期支持版本发布计划改了,不再是原来的 3年一次,而是改成了 2年一次!非长期支持版本还是半年发一次不变,下一个非长期支持版本计划在 2022/03 发布。

https://openjdk.java.net/projects/jdk/17/

特性:

306: 恢复始终严格的浮点语义

356: 增强型伪随机数生成器

382: 新的macOS渲染管道

391: macOS/AArch64 端口

398: 歧义Applet API

403: JDK内部强封装

406: switch模式匹配 (预览)

407: 移除RMI激活

409: 密封类

410: 移除实验性的AOT and JIT 编译器

411: 弃用安全管理器

412: 外部函数和内存API (孵化器)

414: Vector API (二次孵化器)

415: 上下文特定反序列化过滤器

Features

306: Restore Always-Strict Floating-Point Semantics

356: Enhanced Pseudo-Random Number Generators

382: New macOS Rendering Pipeline

391: macOS/AArch64 Port

398: Deprecate the Applet API for Removal

403: Strongly Encapsulate JDK Internals

406: Pattern Matching for switch (Preview)

407: Remove RMI Activation

409: Sealed Classes

410: Remove the Experimental AOT and JIT Compiler

411: Deprecate the Security Manager for Removal

412: Foreign Function & Memory API (Incubator)

414: Vector API (Second Incubator)

415: Context-Specific Deserialization Filters

JDK 16

2021-3-16 发布

https://openjdk.java.net/projects/jdk/16/

特性:

338: Vector API (孵化器)

347: 允许C++14语言特性

357: 从Mercurial迁移至Git

369: 迁移至GitHub

376: ZGC: 并发线程堆栈处理

380: Unix 域套接字通道

386: Alpine Linux 端口

387: 弹性元空间

388: Windows/AArch64 端口

389: 外部链接器 API(孵化器)

390: 基于值的类的警告

392: 打包工具

393: 外部内存访问 API(第三个孵化器)

394: instanceof模式匹配

395: 记录

396: 默认情况下强封装 JDK 内部

397: 密封类 (二次预览)

Features

338: Vector API (Incubator)

347: Enable C++14 Language Features

357: Migrate from Mercurial to Git

369: Migrate to GitHub

376: ZGC: Concurrent Thread-Stack Processing

380: Unix-Domain Socket Channels

386: Alpine Linux Port

387: Elastic Metaspace

388: Windows/AArch64 Port

389: Foreign Linker API (Incubator)

390: Warnings for Value-Based Classes

392: Packaging Tool

393: Foreign-Memory Access API (Third Incubator)

394: Pattern Matching for instanceof

395: Records

396: Strongly Encapsulate JDK Internals by Default

397: Sealed Classes (Second Preview)

JDK 15

2020-9-15 发布

https://openjdk.java.net/projects/jdk/15/

特性:

339: EdDSA 爱德华兹曲线签名算法

360: 密封类 (预览)

371: 隐藏类

372: 移除Nashorn JavaScript 引擎

373: 重新实现旧版 DatagramSocket API

374: 禁用和弃用偏向锁

375: instanceof模式匹配 (二次预览)

377: ZGC 可扩展的低延迟垃圾收集器

378: 文本块

379: Shenandoah: 低暂停时间的垃圾收集器

381: 移除Solaris 和 SPARC 端口

383: 外部内存访问API (二次孵化器)

384: 记录 (二次预览)

385: 弃用RMI激活

Features

339: Edwards-Curve Digital Signature Algorithm (EdDSA)

360: Sealed Classes (Preview)

371: Hidden Classes

372: Remove the Nashorn JavaScript Engine

373: Reimplement the Legacy DatagramSocket API

374: Disable and Deprecate Biased Locking

375: Pattern Matching for instanceof (Second Preview)

377: ZGC: A Scalable Low-Latency Garbage Collector

378: Text Blocks

379: Shenandoah: A Low-Pause-Time Garbage Collector

381: Remove the Solaris and SPARC Ports

383: Foreign-Memory Access API (Second Incubator)

384: Records (Second Preview)

385: Deprecate RMI Activation for Removal

JDK 14

无版本代号, 2020-03-17 发布

https://openjdk.java.net/projects/jdk/14/

特性:

305: instanceof的模式匹配 (预览)

343: 打包工具 (Incubator)

345: G1的NUMA内存分配优化

349: JFR事件流

352: 非原子性的字节缓冲区映射

358: 友好的空指针异常

359: Records (预览)

361: Switch表达式 (标准)

362: 弃用Solaris和SPARC端口

363: 移除CMS(Concurrent Mark Sweep)垃圾收集器

364: macOS系统上的ZGC

365: Windows系统上的ZGC

366: 弃用ParallelScavenge + SerialOld GC组合

367: 移除Pack200 Tools和API

368: 文本块 (第二个预览版)

370: 外部存储器API (Incubator)

Features

305: Pattern Matching for instanceof (Preview)

343: Packaging Tool (Incubator)

345: NUMA-Aware Memory Allocation for G1

349: JFR Event Streaming

352: Non-Volatile Mapped Byte Buffers

358: Helpful NullPointerExceptions

359: Records (Preview)

361: Switch Expressions (Standard)

362: Deprecate the Solaris and SPARC Ports

363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector

364: ZGC on macOS

365: ZGC on Windows

366: Deprecate the ParallelScavenge + SerialOld GC Combination

367: Remove the Pack200 Tools and API

368: Text Blocks (Second Preview)

370: Foreign-Memory Access API (Incubator)

JDK 13

2019-09-17 发布

https://openjdk.java.net/projects/jdk/13/

特性:

350: 动态程序类数据共享;

351: ZGC: 释放未使用的内存;

353: 重新实现Socket API

354: Switch 表达式(预览);

355: 文本块(预览);

Features

350: Dynamic CDS Archives

351: ZGC: Uncommit Unused Memory

353: Reimplement the Legacy Socket API

354: Switch Expressions (Preview)

355: Text Blocks (Preview)

JDK 12

2019-03-19 发布

https://openjdk.java.net/projects/jdk/12/

特性:

189: 低停顿垃圾收集器Shenandoah (实验);

230: 微基准套件;

325: Switch 表达式(预览);

334: JVM 常量 API;

340: AArch64 的实现(一个端口);

341: 使用默认类数据共享(CDS)存档;

344: 可中止的G1 Mixed GC

346: G1及时返回未使用的已分配内存

Features
189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)

230: Microbenchmark Suite

325: Switch Expressions (Preview)

334: JVM Constants API

340: One AArch64 Port, Not Two

341: Default CDS Archives

344: Abortable Mixed Collections for G1

346: Promptly Return Unused Committed Memory from G1

JDK 11

无版本代号, 2018-09-25 发布。

https://openjdk.java.net/projects/jdk/11/

特性:

181: 基于嵌套的访问控制

309: 动态类文件常量

315: 改进Aarch64 Intrinsics

318: Epsilon: 一个无操作的垃圾收集器

320: 移除Java EE和CORBA模块

321: HTTP客户端(标准)

323: 本地变量语法Lambda参数

324: 与Curve25519和Curve448的密钥一致

327: Unicode 10

328: JFR 低开销的数据框架

329: ChaCha20 和 Poly1305 密码算法

330: 启动单文件源代码程序

331: 低开销堆分析

332: TLS (Transport Layer Security) 1.3

333: ZGC: 低延迟垃圾收集器 (实验)

335: 已弃用 Nashorn JavaScript 引擎

336: 已弃用 Pack200 Tools and API

Features

181: Nest-Based Access Control

309: Dynamic Class-File Constants

315: Improve Aarch64 Intrinsics

318: Epsilon: A No-Op Garbage Collector

320: Remove the Java EE and CORBA Modules

321: HTTP Client (Standard)

323: Local-Variable Syntax for Lambda Parameters

324: Key Agreement with Curve25519 and Curve448

327: Unicode 10

328: Flight Recorder

329: ChaCha20 and Poly1305 Cryptographic Algorithms

330: Launch Single-File Source-Code Programs

331: Low-Overhead Heap Profiling

332: Transport Layer Security (TLS) 1.3

333: ZGC: A Scalable Low-Latency Garbage Collector
   (Experimental)

335: Deprecate the Nashorn JavaScript Engine

336: Deprecate the Pack200 Tools and API

JDK 10

无版本代号, 2018-03-20 发布

https://openjdk.java.net/projects/jdk/10/

特性:

286: 局部变量类型推断

296: JDK库合并

304: 统一的垃圾回收接口

307: 为G1提供并行的Full GC

310: 应用程序类数据共享

312: ThreadLocal握手交互

313: 移除 Native-Header 自动生成工具(javah)

314: 使用额外的Unicode语言标记拓展

316: 能将对内存占用分配给用户指定的备用内存设备

317: 使用基于JAVA的JIT编译器

319: 根证书

322: 基于时间的发布版本

Features

286: Local-Variable Type Inference

296: Consolidate the JDK Forest into a Single Repository

304: Garbage-Collector Interface

307: Parallel Full GC for G1

310: Application Class-Data Sharing

312: Thread-Local Handshakes

313: Remove the Native-Header Generation Tool (javah)

314: Additional Unicode Language-Tag Extensions

316: Heap Allocation on Alternative Memory Devices

317: Experimental Java-Based JIT Compiler

319: Root Certificates

322: Time-Based Release Versioning

JDK 9

无版本代号, 2017-09-21 发布。

https://openjdk.java.net/projects/jdk9/

特性:

【新增】模块化,进而使得 JDK 目录结构发生变化;

【新增】交互式编程环境 REPL(JShell);

【新增】轻量级 JSON API;

【新增】响应式流 (Reactive Streams) API

【新增】HTTP 2.0 客户端;

【新增】多版本兼容 jar 包;

【新增】货币相关的 API;

【新增】代码分段缓存;

【新增】智能 Java 编译,第二阶段;

【提升】集合: 提供集合工厂方法;

【提升】接口: 私有接口方法;

【提升】String: 底层存储结构更换;

【提升】API:进程、Stream、@Deprecated、 Optional、CompletableFuture 等;

【提升】锁争用机制;

【提升】简化进程 API;

【提升】Javadoc 的提升

Features

102: Process API Updates

110: HTTP 2 Client

143: Improve Contended Locking

158: Unified JVM Logging

165: Compiler Control

193: Variable Handles

197: Segmented Code Cache

199: Smart Java Compilation, Phase Two

200: The Modular JDK

201: Modular Source Code

211: Elide Deprecation Warnings on Import Statements

212: Resolve Lint and Doclint Warnings

213: Milling Project Coin

214: Remove GC Combinations Deprecated in JDK 8

215: Tiered Attribution for javac

216: Process Import Statements Correctly

217: Annotations Pipeline 2.0

219: Datagram Transport Layer Security (DTLS)

220: Modular Run-Time Images

221: Simplified Doclet API

222: jshell: The Java Shell (Read-Eval-Print Loop)

223: New Version-String Scheme

224: HTML5 Javadoc

225: Javadoc Search

226: UTF-8 Property Files

227: Unicode 7.0

228: Add More Diagnostic Commands

229: Create PKCS12 Keystores by Default

231: Remove Launch-Time JRE Version Selection

232: Improve Secure Application Performance

233: Generate Run-Time Compiler Tests Automatically

235: Test Class-File Attributes Generated by javac

236: Parser API for Nashorn

237: Linux/AArch64 Port

238: Multi-Release JAR Files

240: Remove the JVM TI hprof Agent

241: Remove the jhat Tool

243: Java-Level JVM Compiler Interface

244: TLS Application-Layer Protocol Negotiation Extension

245: Validate JVM Command-Line Flag Arguments

246: Leverage CPU Instructions for GHASH and RSA

247: Compile for Older Platform Versions

248: Make G1 the Default Garbage Collector

249: OCSP Stapling for TLS

250: Store Interned Strings in CDS Archives

251: Multi-Resolution Images

252: Use CLDR Locale Data by Default

253: Prepare JavaFX UI Controls & CSS APIs for Modularization

254: Compact Strings

255: Merge Selected Xerces 2.11.0 Updates into JAXP

256: BeanInfo Annotations

257: Update JavaFX/Media to Newer Version of GStreamer

258: HarfBuzz Font-Layout Engine

259: Stack-Walking API

260: Encapsulate Most Internal APIs

261: Module System

262: TIFF Image I/O

263: HiDPI Graphics on Windows and Linux

264: Platform Logging API and Service

265: Marlin Graphics Renderer

266: More Concurrency Updates

267: Unicode 8.0

268: XML Catalogs

269: Convenience Factory Methods for Collections

270: Reserved Stack Areas for Critical Sections

271: Unified GC Logging

272: Platform-Specific Desktop Features

273: DRBG-Based SecureRandom Implementations

274: Enhanced Method Handles

275: Modular Java Application Packaging

276: Dynamic Linking of Language-Defined Object Models

277: Enhanced Deprecation

278: Additional Tests for Humongous Objects in G1

279: Improve Test-Failure Troubleshooting

280: Indify String Concatenation

281: HotSpot C++ Unit-Test Framework

282: jlink: The Java Linker

283: Enable GTK 3 on Linux

284: New HotSpot Build System

285: Spin-Wait Hints

287: SHA-3 Hash Algorithms

288: Disable SHA-1 Certificates

289: Deprecate the Applet API

290: Filter Incoming Serialization Data

291: Deprecate the Concurrent Mark Sweep (CMS) Garbage Collector

292: Implement Selected ECMAScript 6 Features in Nashorn

294: Linux/s390x Port

295: Ahead-of-Time Compilation

297: Unified arm32/arm64 Port

298: Remove Demos and Samples

299: Reorganize Documentation

JDK 8

版本代号为 Spider(蜘蛛), 2014-03-18 发布, major.minor 版本为 52

特性:

【新增】Lambda 表达式;

【新增】管道和 stream;

【新增】新的日期和时间 API;

【新增】函数式接口;

【新增】接口的默认方法,又称为扩展方法;

【新增】方法与构造函数的引用;

【新增】Optional API;

【新增】并行操作;

【新增】新工具,如 Nashorn 引擎 jjs、类依赖分析器 jdeps;

【提升】支持多重注解,并新增了部分注解;

JDK 7

版本代号为 Dolphin(海豚), 2011-07-28 发布, major.minor 版本为 51

特性:

【新增】Fork and Join

【提升】创建泛型对象时应用类型推导,钻石表达式;

【提升】自动资源管理(try-with-resources);

【提升】异常捕获的处理方式(通过 | 捕获多个异常),

【提升】 Java NIO2 API(working with path 和 file change notification);

【提升】switch 的分支条件支持字符串;

【提升】集合中新增 TransferQueue 接口,是 BlockingQueue 的改进版,实现类为 LinkedTransferQueue;

【提升】JDBC4.1: try-with-resources 和 RowSet1.1

【提升】网络、Swing、XML 处理、国际化等 API 的提升

【提升】JVM方面, 支持非 Java 语言, Garbage-First-Collector 和提升了 Java HotSpot 虚拟机的性能;
reference-jdk7

JDK 6

版本代号为 Mustang(野马), 2006-12-11 发布, major.minor 版本为 50

特性:

【新增】Web 服务元数据;

【新增】脚本语言支持;

【新增】JTable 的排序和过滤;

【新增】轻量级的 Http Server;

【新增】插入式注解处理 API(Pluggable Annotation Processing API);

【新增】支持嵌入式数据库 Derby;

【新增】Console API;

【新增】Compile API;

【新增】StAX(Streaming API for XML) 处理 XML;

【提升】引入 JAXB2 来处理对象和 XML 之间的映射;

【提升】AWT 中新增了两个类 Desktop 和 SystemTray, 极不常用;

【提升】Common Annotations;

【提升】JAX-WS2.0;

【提升】JDBC4.0;

【提升】引入新的 GC 算法;

JDK 5

版本代号为 Tiger(老虎), 2004-09-30 发布, major.minor 版本为 49。从 JDK5 开始, JDK 的版本不再以 1.x 的方式来命名了, 而是直接用 x 来命名。

特性:

【新增】泛型 Generics

This long-awaited enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting. Refer to JSR 14.

【新增】增强 for 循环 Enhanced for Loop

This new language construct eliminates the drudgery and error-proneness of iterators and index variables when iterating over collections and arrays. Refer to JSR 201 .

【新增】自动装箱与自动拆箱 Autoboxing/Unboxing

This facility eliminates the drudgery of manual conversion between primitive types (such as int) and wrapper types (such as Integer). Refer to JSR 201 .

【新增】类型安全的枚举 Typesafe Enums

This flexible object-oriented enumerated type facility allows you to create enumerated types with arbitrary methods and fields. It provides all the benefits of the Typesafe Enum pattern ("Effective Java," Item 21) without the verbosity and the error-proneness. Refer to JSR 201.

【新增】支持可变参数 Varargs

This facility eliminates the need for manually boxing up argument lists into an array when invoking methods that accept variable-length argument lists. Refer to JSR 201.

【新增】静态导入 Static Import

This facility lets you avoid qualifying static members with class names without the shortcomings of the "Constant Interface antipattern." Refer to JSR 201.

【新增】注解:动态注解、元数据 Metadata (Annotations)

This language feature lets you avoid writing boilerplate code under many circumstances by enabling tools to generate it from annotations in the source code. This leads to a "declarative" programming style where the programmer says what should be done and tools emit the code to do it. Also it eliminates the need for maintaining "side files" that must be kept up to date with changes in source files. Instead the information can be maintained in the source file. Refer to JSR 175.

JDK 1.4

版本代号为 Merlin(隼), 2004-02-06 发布(首次在 JCP 下发行), major.minor 版本为 48

特性:

【新增】XML处理;

【新增】Java打印服务;

【新增】Logging API;

【新增】Java Web Start;

【新增】断言;

【新增】引入Preferences API;

【新增】链式异常处理;

【新增】支持IPV6;

【新增】正则表达式;

【新增】Image I/O API;

【新增】NIO API;

【新增】集成 JCE、JSSE、JAAS;

【提升】引入JDBC 3.0 API;

JDK 1.3

版本代号为 Kestrel(红隼), 2000-05-08 发布, major.minor 版本为 47

特性:

【新增】Java Sound API, 已被淘汰;

【新增】jar文件索引;

【新增】JVM 配备 HotSpot JVM;

【新增】代理类;

【新增】Java 命名与目录接口;

【新增】Java 平台调试体系;

JDK 1.2

版本代号为 Playground(操场), 1998-12-08 发布, major.minor 版本为 46

特性:

【新增】集合框架;

【新增】对字符串常量做内存映射;

【新增】JIT(Just In Time) 编译器;

【新增】对打包的 Java 文件进行数字签名;

【新增】控制授权访问系统资源的策略工具;

【新增】JFC(Java Foundation Classes), 包括 Swing 1.0, 拖放和 Java2D 类库,很少使用, 主要的使用场景是用在后端生成图片的业务场景, 如二维码生成;

【新增】Java 插件;

【新增】strictfp 关键字;

【提升】在 JDBC 中引入可滚动结果集, BLOB, CLOB, 批量更新和用户自定义类型;

【提升】在 Applet 中添加声音支持, 已被淘汰;

JDK 1.1

无版本代号, 1997-02-19 发布, major.minor 版本为 45

特性:

【新增】JDBC(Java Database Connectivity), 注意不是 Connection;

【新增】内部类;

【新增】Java Bean;

【新增】RMI(Remote Method Invocation);

【新增】反射(仅用于内省);

【提升】IO 引入 Reader/Writer 及其子类;

JDK 1.0

版本代号为 Oak(橡树), 1996-01-23 发布

主要特性:

【新增】JVM;

【新增】Applet: 已被淘汰;

【新增】AWT(Abstract Window ToolKit): 已被淘汰;

【新增】File 和 IO(InputStream/OutputStream) 相关操作 API;