JDK 8 · JSR 337 · Long-term support

Java 8

Java SE 8 is JSR 337, released in March 2014. Oracle and other vendors have treated it as a long-term support line. This is the functional release: lambdas, the stream library, Optional, and java.time. The chapters on lambdas and streams teach those topics in depth. This page only says what arrived.

Language

Default and static interface methods

Final · Language

An interface can carry a default instance method and a static method. That is how Collection gained stream() without breaking existing classes.

Related reading: Abstraction and interfaces

Curriculum file: versions3Java8Features.java

APIs / Libraries

Stream API

Final · APIs / Libraries

A stream is a pipeline of intermediate operations and one terminal operation. Intermediate work stays lazy until the terminal operation runs.

Related reading: Streams and Optional

Curriculum file: versions3Java8Features.java

java.time

Final · APIs / Libraries

The java.time package replaces the mutable java.util.Date and Calendar model for civil dates, times, and instants.

Curriculum file: versions3Java8Features.java

CompletableFuture

Final · APIs / Libraries

A completion stage composes asynchronous work. It is not the virtual-thread API. Virtual threads arrive as a preview in Java 19 and become final in Java 21.

Related reading: Concurrency

JVM / Runtime

Metaspace

Final · JVM / Runtime

Class metadata moves from the fixed PermGen space to Metaspace. This is a JVM change, not a source change.

Related reading: JVM and memory

Tools / Platform

Nashorn

Final · Tools / Platform

Nashorn is a JavaScript engine that shipped in Java 8. Java 11 deprecates it. Java 15 removes it.

Examples

  • versions3Java8Features.javaJava 8 example · Requires Java 8Lambdas, a default method, method references, streams, Optional, and java.time.

Related reading

Historical notes

Java 8 is the baseline many later migrations leave. The Java 11 page lists what changed between these two long-lived releases, without ranking them.

Sources. Release month and JSR 337: Oracle Java SE specifications. Feature set: the Java versions reference and versions3Java8Features.java. Oracle Java SE specifications (leaves JavaMastery)

All versions