Java 11 Tutorial

16 posts in this section

Removed and Deprecated APIs: Java EE, JavaFX, Nashorn (JEP 320, 335, 336)

Removal Timeline API Deprecated In Removed In JEP Java EE modules (JAXB, JAX-WS, etc.) Java 9 Java 11 JEP 320 JavaFX Bundled with Java 9 Unbundled in Java 11 — Nashorn JavaScript Engine Java 11 Java 15 JEP 335 Pack200 tools and API Java 11 Java 14 JEP 336 javah tool Java 9 Java 10 JEP 313 sun.misc.BASE64Encoder/Decoder Java 8 Java 11 Encapsulation Thread.destroy(), Thread.stop(Throwable) Old Java 11 — Applet API Java 9 Java 17 JEP 289 Java EE Modules Removed (JEP 320) The six Java EE modules that shipped with Java SE 6–10 were removed from Java 11.

Continue reading »

Security: TLS 1.3, ChaCha20-Poly1305, and Curve25519 (JEP 329, 332, 324)

Security Improvements Across Java 9–11 JEP Release Feature JEP 287 Java 9 SHA-3 hash algorithms JEP 273 Java 9 DRBG-based SecureRandom JEP 288 Java 9 Disable SHA-1 certificates JEP 324 Java 11 Key Agreement with Curve25519 and Curve448 JEP 329 Java 11 ChaCha20 and Poly1305 cryptographic algorithms JEP 332 Java 11 Transport Layer Security (TLS) 1.3 JEP 181 Java 11 Nest-Based Access Control TLS 1.3 (JEP 332) TLS 1.3 is the current version of the Transport Layer Security protocol, finalised in RFC 8446 (August 2018).

Continue reading »

Setting Up Java 11: JDK Options, Maven/Gradle, and IDE Configuration

Choosing a JDK Distribution Java 11 is available from multiple OpenJDK distributions. All are TCK-certified and binary-compatible; the differences are support timelines and add-ons. Distribution Vendor Java 11 Support Until Notes Eclipse Temurin Adoptium Oct 2027 Community standard, most downloaded Amazon Corretto Amazon Aug 2024 (free), extended via AWS Best choice for AWS workloads Azul Zulu Azul Systems 2026+ Wide platform coverage Microsoft Build of OpenJDK Microsoft 2024 Best for Azure Oracle JDK 11 Oracle Oct 2024 (free LTS) Commercial support until 2026 GraalVM CE 21 Oracle/GraalVM Community Native image + polyglot; JDK 21-based For most teams: Eclipse Temurin 11 — widest platform support, longest free support window, backed by a vendor-neutral foundation.

Continue reading »

Stream & Optional API Enhancements (Java 9–11)

Stream API — New Methods (Java 9) Java 9 added four new instance methods to Stream<T>. All are terminal-ish or intermediate operations that make common patterns expressible without workarounds. takeWhile(Predicate) Returns elements from the beginning of the stream as long as the predicate holds, then stops. The first element that fails the predicate (and all subsequent elements) are discarded. Stream.of(1, 2, 3, 4, 5, 1, 2) .takeWhile(n -> n < 4) .

Continue reading »

Tooling: JShell, jlink, and Single-File Programs (JEP 222, 282, 330)

Overview Java 9 and 11 added three tools that change how you write, test, and deploy Java code: Tool JEP Release Purpose JShell JEP 222 Java 9 Interactive REPL for Java code jlink JEP 282 Java 9 Build minimal custom JRE images Single-file programs JEP 330 Java 11 Run .java files directly JShell — Interactive Java REPL JShell is Java’s Read-Eval-Print Loop: a command-line tool for evaluating Java expressions, statements, methods, and classes interactively, without creating a project.

Continue reading »

var Keyword (JEP 286, 323): Local Variable Type Inference

What var Does var is a reserved type name (not a keyword) introduced in Java 10 (JEP 286). It instructs the compiler to infer the type of a local variable from its initialiser. The inferred type is fixed at compile time — var does not make Java dynamically typed. // Before var ArrayList<String> names = new ArrayList<String>(); Map<String, List<Integer>> scores = new HashMap<String, List<Integer>>(); // With var var names = new ArrayList<String>(); var scores = new HashMap<String, List<Integer>>(); After compilation, both forms produce identical bytecode.

Continue reading »