Skip to content
Veltoryx Technologies
ProLesson 13.3Intermediate2 min readUpdated 30 October 2026

Java 9 to 11: modules, var and the HTTP client

The module system, jshell, collection factory methods, var, the new HTTP client and the String and Files helpers that arrived on the way to Java 11 LTS.

Java 9, 10 and 11 arrived in quick succession and led to the Java 11 LTS. Here's what you'll actually use and be asked about.

01Java 9 (2017)

The module system (JPMS, Project Jigsaw). A module groups packages and declares what it exports and what it requires, in a module-info.java:

java
module com.veltoryx.shop {
    requires java.sql;                  // depends on this module
    exports com.veltoryx.shop.api;      // only this package is visible to others
}

It gives strong encapsulation (internal packages stay hidden, even from reflection) and let the JDK itself be split into modules. Most application code still uses the classpath, but you'll meet modules in libraries and when building small runtime images with jlink.

Also in Java 9:

  • jshell: an interactive console for trying Java snippets.
  • Collection factories: List.of, Set.of, Map.of (immutable).
  • Private methods in interfaces.
  • Stream additions: takeWhile, dropWhile, iterate with a condition; Optional.ifPresentOrElse, or and stream.
  • G1 became the default GC.

Loading the rest of the lesson…