Java 8 Is Released

2 minute read

Published:

Java 8 (JDK 8) was released on March 18, 2014, under Oracle’s stewardship after completing development as Project Lambda (JSR 335), led primarily by Brian Goetz. The central addition was lambda expressions: anonymous functions passed as values, enabling code like list.stream().filter(x -> x.size() > 5).map(String::toUpperCase).collect(toList()) instead of a loop with anonymous Comparator or Runnable inner classes. Lambdas required a complementary language feature — functional interfaces (interfaces with exactly one abstract method, annotated optionally with @FunctionalInterface) — and a new syntax for method references (String::length, System.out::println, ArrayList::new), which allowed passing existing named methods where lambdas would otherwise be used.

The Stream API (java.util.stream) built a lazy pipeline model on top of lambdas: operations like filter(), map(), flatMap(), sorted(), distinct(), and limit() composed into a description of a computation that executed only when a terminal operation (collect(), count(), reduce(), findFirst()) consumed it. parallelStream() replaced the stream’s sequential iterator with a ForkJoinPool-based parallel spliterator, allowing multi-threaded aggregate operations on collections with a single method name change — though thread safety of the underlying data structure and the functions applied remained the developer’s responsibility. Java 8 also added default interface methods (allowing library authors to add methods to existing interfaces without breaking all existing implementations — critical for retrofitting Stream support onto Collection without breaking every List and Set subclass in existence), CompletableFuture (composable asynchronous computations chained with thenApply(), thenCompose(), exceptionally()), Optional for representing absent values without null pointer exceptions, and the Nashorn JavaScript engine (replacing Rhino).

The java.time package (JSR 310) replaced java.util.Date and Calendar — both mutable, poorly designed, and unable to represent time zones consistently — with an immutable API inspired by the Joda-Time library (authored by Stephen Colebourne, who co-led JSR 310). LocalDate, LocalDateTime, ZonedDateTime, Instant, Duration, and Period covered distinct temporal concepts cleanly. Java 8 became the longest-lived Java release in widespread production use: its LTS designation (Oracle extended support until 2030 for commercial subscribers; Adoptium/Red Hat continued OpenJDK 8 free distributions) and the library ecosystem’s stabilization around its APIs meant that Java 8 remained the baseline for Spring Boot, Hibernate, and enterprise Java frameworks well into the late 2010s. Google’s Android added Java 8 language feature support through the d8/R8 compiler pipeline for all Android API levels from 2017, extending Java 8 syntax to the mobile development context.