Fundamentals 18 min read

Overview of Java 9 New Features and JEP Enhancements

This article provides a comprehensive overview of Java 9’s major new features—including the JPMS (Jigsaw) module system, updated APIs, security improvements, the new HTTP/2 client, AOT compilation, and the time‑driven release model—illustrated with code examples and practical guidance for developers.

Qunar Tech Salon
Qunar Tech Salon
Qunar Tech Salon
Overview of Java 9 New Features and JEP Enhancements

This article, originally published by the ArchNotes community, introduces the most important new features of Java 9 after three years of development, and explains Oracle’s time‑driven release model for rapid innovation in cloud and big‑data environments.

1. Jigsaw (JPMS) Module System – Java 9 introduces the Java Platform Module System (JSR 376, JPMS) to replace the fragile classpath. It defines explicit module boundaries and dependencies, improving encapsulation and reliability. The six core JEPs (261, 200, 201, 220, 260, 282) implement the module system, modular JDK, modular source code, modular runtime images, internal API encapsulation, and the new jlink tool.

2. New Java 9 APIs

Process API (JEP 102) – ProcessHandle current = ProcessHandle.current(); and related methods enable easy access to process information, monitoring, and termination.

Convenient factory methods for collections (JEP 269) – e.g., Set<String> alphabet = Set.of("a", "b", "c"); creates an unmodifiable set in a single line.

Flow API for reactive streams (JEP 166) – introduces Publisher, Subscriber, and Processor interfaces for asynchronous data processing.

Stack‑Walking API (JEP 259) and VarHandle (JEP 193) provide low‑level, high‑performance access to the JVM stack and memory fences.

3. Security Enhancements

DTLS support (JEP 219), default keystore format switched to PKCS12 (JEP 229), ALPN for HTTP/2 (JEP 244), OCSP stapling (JEP 249), DRBG‑based SecureRandom (JEP 273), and SHA‑3 algorithms (JEP 287).

4. Networking and HTTP/2 Client – JEP 110 adds a modern HTTP/2 client API (still incubating) that supports synchronous and asynchronous calls with a fluent builder style, replacing HttpURLConnection . Example usage:

HttpClient client = HttpClient.newBuilder()
    .sslContext(sslContext)
    .version(HTTP_2)
    .build();
HttpRequest req = HttpRequest.newBuilder(uri)
    .POST()
    .build();
client.sendAsync(req, bodyHandler).thenApply(...);

5. Multi‑Release JAR Files (JEP 238) – Allows a single JAR to contain version‑specific class files, simplifying support for multiple JDK versions.

6. AOT Compilation (JEP 295) – The jaotc tool can compile classes to native shared libraries (e.g., jaotc --output libHelloWorld.so HelloWorld.class ) to improve startup performance on Linux x64.

7. JVM and GC Improvements

G1 becomes the default collector (JEP 248).

Removal of deprecated CMS (JEP 214) and deprecation of CMS (JEP 291).

Unified JVM logging (JEP 158/271).

Contended lock optimizations (JEP 143) and spin‑wait hints (JEP 285).

8. Future Release Model – Oracle plans a time‑driven, six‑month release cadence with Long‑Term Support (LTS) every three years, and increased open‑source contributions (e.g., Java Flight Recorder).

9. Q&A Highlights

Use JPMS to avoid JAR hell.

AOT currently produces native libraries, not standalone executables; use jlink for custom runtimes.

Pattern‑matching and coroutine support are under discussion in OpenJDK.

JEPs are proposals that may become JSRs; they complement, not replace, the JCP process.

securityAOTJava 9jepJLinkJPMSProcess API
Qunar Tech Salon
Written by

Qunar Tech Salon

Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.