Stable Release in branch Java SE 9
9.0.4
Released 16 Jan 2018
(8 years ago)
SoftwareJava/Java SE
VersionJava SE 9
Status
End of life
Class file version53.0
Initial release9
21 Sep 2017
(8 years ago)
Latest release9.0.4
16 Jan 2018
(8 years ago)
End of
premier support
Mar 2018
(Ended 8 years ago)
End of
extended support
Unavailable
Release noteshttps://www.oracle.com/java/technologies/javase/v901-relnotes.html
Documentationhttps://docs.oracle.com/javase/9
Downloadhttps://www.oracle.com/java/technologies/javase/javase9-archive-downloads.html
Java/Java SE Java SE 9 ReleasesView full list

What Is New in Java 9

Java 9 is a major release centered around the Java Platform Module System (JPMS), which fundamentally changes how applications are structured and deployed. Alongside this, it delivers a new HTTP client, improved APIs, and a collection of new tools for developers.

Category Key Changes
New Features Java Platform Module System (Project Jigsaw), jshell, HTTP/2 Client
API Improvements Process API updates, new Stream and Optional methods, reactive streams
Tools & JVM Multi-Release JAR Files, new HTML5 Javadoc, compiler control
Security DTLS support, SHA-3 hashing, disabled SHA-1 certs
Deprecated/Removed Deprecated Applet API, removed JVM TI hprof agent

How does the Module System change Java development?

The Java Platform Module System (JPMS), also known as Project Jigsaw, introduces a new level of abstraction above packages. It allows you to declare explicit dependencies and define which packages are publicly accessible, enforcing strong encapsulation.

In practice, this means you can create a module-info.java file to define your module's name, its required dependencies, and the packages it exports. This solves long-standing issues like the brittle classpath and JAR hell.

module com.example.myapp {
    requires java.sql;
    requires com.example.mylibrary;
    exports com.example.myapp.api;
}

This modularization also enabled the restructuring of the JDK itself into modules, leading to the creation of smaller, customized runtime images using the jlink tool.

What new tools are available for developers?

Java 9 shipped with jshell, the first official REPL (Read-Eval-Print Loop) for Java. It lets you quickly test code snippets, expressions, and APIs without compiling a full class, which is fantastic for prototyping and learning.

The HTTP/2 Client API was introduced as an incubator module (jdk.incubator.http), providing a modern, non-blocking alternative to the old HttpURLConnection. It supports HTTP/2 and WebSocket out of the box.

Multi-Release JAR Files

This feature allows a single JAR file to contain different versions of class files tailored for different Java versions. You can have Java 9-specific code in a META-INF/versions/9 directory while maintaining backward compatibility.

Which API improvements should I start using?

The Process API received significant upgrades for managing native operating system processes. You can now easily get the PID, command line arguments, and children of a process, which was notoriously difficult before.

New convenience methods were added to core interfaces. The Stream API got takeWhile, dropWhile, and iterate overloads for more expressive filtering. The Optional class gained methods like ifPresentOrElse and or for better handling of empty values.

List<String> result = stream
    .takeWhile(s -> s.length() < 5)
    .collect(Collectors.toList());

Java 9 also included the reactive streams API in the java.util.concurrent package, providing a standard for asynchronous stream processing with backpressure.

What security enhancements were implemented?

Support for the Datagram Transport Layer Security (DTLS) protocol was added, enabling secure communication for datagram-based applications. The SHA-3 family of cryptographic hash algorithms is now available for use.

A crucial change was the disabling of SSLv3 and TLS 1.0 for FTPS implementations to align with modern security standards. Certificates signed with the SHA-1 hash algorithm were also deprecated and disabled by default for TLS connections.

FAQ

Is the module system mandatory in Java 9?
No, the module system is not mandatory. Your existing classpath-based applications will continue to run on the Java 9 JVM unchanged. The entire JDK is now modularized, but the classpath remains fully supported.

What is the status of the HTTP/2 Client?
In Java 9, the HTTP/2 Client is delivered as an incubator module (jdk.incubator.http). This means its API is not final and could change in future releases based on feedback. You must explicitly include it in your module path.

Can I use jlink with non-modular applications?
No, jlink requires all application code and its dependencies to be modules with a module-info.java file. It analyzes these explicit dependencies to create a minimal runtime image that contains only the necessary JDK modules.

Why was the Applet API deprecated?
The Applet API was deprecated because modern web browsers have either removed or announced the removal of support for Java browser plugins. The web industry has moved towards alternative technologies like WebAssembly for in-browser applications.

What are the most common issues when migrating to Java 9?
The most common issues involve illegal reflective access. Many libraries used reflection to access JDK internals, which is now prohibited by the module system's strong encapsulation. You might see warnings that require library updates or the use of command-line flags like --add-opens as a temporary workaround.

Releases In Branch Java SE 9

VersionRelease date
9.0.416 Jan 2018
(8 years ago)
9.0.117 Oct 2017
(8 years ago)
921 Sep 2017
(8 years ago)