<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Java17 on Devops Monk</title><link>https://devops-monk.com/tags/java17/</link><description>Recent content in Java17 on Devops Monk</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 04 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://devops-monk.com/tags/java17/index.xml" rel="self" type="application/rss+xml"/><item><title>Context-Specific Deserialization Filters (JEP 415): Securing Java Deserialization</title><link>https://devops-monk.com/tutorials/java17/deserialization-filters/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/deserialization-filters/</guid><description>Finalized in Java 17 (JEP 415). Extends JEP 290 (Java 9), which introduced the basic deserialization filter API.
Why Deserialization Is Dangerous Java object deserialization (ObjectInputStream.readObject()) is one of the most exploited attack surfaces in Java. When a Java application deserializes untrusted bytes, the JVM instantiates arbitrary classes and calls their methods as a side effect — before your application code even sees the result.
Attackers craft gadget chains: sequences of serializable classes in common libraries (Apache Commons Collections, Spring Framework, etc.</description></item><item><title>Enhanced Pseudo-Random Number Generators (JEP 356): A Modern PRNG API</title><link>https://devops-monk.com/tutorials/java17/enhanced-prng/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/enhanced-prng/</guid><description>Finalized in Java 17 (JEP 356).
The Problem with Java&amp;rsquo;s Old PRNG API Java&amp;rsquo;s random number generation before Java 17 had several problems:
1. java.util.Random has poor statistical properties. The default PRNG algorithm is a 48-bit linear congruential generator (LCG). It fails many statistical tests (spectral test, birthday test). Its 2^48 period is short — exhaustible in seconds on modern hardware.
2. No common interface. java.util.Random, java.util.concurrent.ThreadLocalRandom, java.util.SplittableRandom, and java.</description></item><item><title>Foreign Function &amp; Memory API (JEP 412): First Look at Project Panama</title><link>https://devops-monk.com/tutorials/java17/foreign-function-memory/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/foreign-function-memory/</guid><description>Incubator Feature in Java 17 (JEP 412 — First Incubator). Package: jdk.incubator.foreign. Requires --add-modules jdk.incubator.foreign at compile and runtime. This API evolved significantly across Java 18 (JEP 419), 19 (JEP 424), 20 (JEP 434), and was finalized in Java 22 (JEP 454). See the Java 21 article series for the final API. This article covers the Java 17 incubator version and the Project Panama vision.
Why Replace JNI? Java Native Interface (JNI) has been the way to call native code from Java since Java 1.</description></item><item><title>Java 17 Production Checklist and Performance Best Practices</title><link>https://devops-monk.com/tutorials/java17/production-best-practices/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/production-best-practices/</guid><description>Production Baseline JVM Flags Start every Java 17 production deployment with this baseline:
java \ # GC — choose one (see GC section) -XX:+UseG1GC \ -XX:MaxGCPauseMillis=200 \ \ # Heap sizing -Xms4g -Xmx4g \ \ # GC logging — essential for diagnosis -Xlog:gc*:file=/var/log/app/gc.log:time,uptime,level,tags:filecount=5,filesize=20m \ \ # OOM diagnostics -XX:+HeapDumpOnOutOfMemoryError \ -XX:HeapDumpPath=/var/log/app/heap-dump.hprof \ -XX:+ExitOnOutOfMemoryError \ \ # Metaspace -XX:MaxMetaspaceSize=512m \ \ # Code cache -XX:ReservedCodeCacheSize=512m \ \ # JFR — always-on profiling -XX:StartFlightRecording=duration=0,filename=/var/log/app/profile.</description></item><item><title>Java 17: The LTS That Delivers — What Changed from Java 11</title><link>https://devops-monk.com/tutorials/java17/java17-overview/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/java17-overview/</guid><description>Java 17: The Landmark LTS Java 17 was released on September 14, 2021 as a Long-Term Support (LTS) release. It is the successor to Java 11 (released September 2018) as the recommended production baseline for enterprise and cloud Java deployments.
Between Java 11 and Java 17, six non-LTS releases (Java 12 through 16) delivered a continuous stream of language improvements on a six-month cadence. Java 17 is where five of the most important new features — Records, Sealed Classes, Pattern Matching for instanceof, Text Blocks, and Switch Expressions — all reached their final, production-ready status simultaneously.</description></item><item><title>JDK Encapsulation and Removed APIs (JEP 403, 306, 407, 411): What It Means for Your Code</title><link>https://devops-monk.com/tutorials/java17/jdk-encapsulation-removed-apis/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/jdk-encapsulation-removed-apis/</guid><description>Overview Java 17 includes several platform changes that can break existing code during migration. This article covers four JEPs that affect compatibility:
JEP Change Impact 403 Strongly Encapsulate JDK Internals HIGH — breaks libraries using internal APIs 407 Remove RMI Activation LOW — niche feature, deprecated since Java 15 411 Deprecate Security Manager MEDIUM — some applications use SecurityManager 306 Restore Always-Strict Floating-Point LOW — affects numeric edge cases JEP 403: Strongly Encapsulate JDK Internals What Changed In Java 8 and earlier, code could access any JDK internal API via reflection — setAccessible(true) bypassed access controls.</description></item><item><title>Migrating to Java 17: From Java 8 and Java 11 — Step by Step</title><link>https://devops-monk.com/tutorials/java17/migration-guide/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/migration-guide/</guid><description>Why Migrate to Java 17? Java 17 is the current recommended enterprise LTS. Key reasons to migrate now:
Spring Boot 3.x requires Java 17 — the entire Spring ecosystem is moving here Java 11 extended support ends around 2026 depending on your vendor Java 8 mainstream support ended in 2019; extended support ended 2030 for Oracle JDK but active vulnerability exposure is increasing Language features: Records, Sealed Classes, Text Blocks, Pattern Matching, Switch Expressions — all available in Java 17 Security: Strong JDK encapsulation closes years of internal API exposure used in exploits Recommended Migration Path Java 8 → Java 11 → Java 17 Do not jump directly from Java 8 to Java 17 in one step if your codebase is large or has many third-party dependencies.</description></item><item><title>Migrating to Java 21: From Java 8, 11, and 17 — Step by Step</title><link>https://devops-monk.com/tutorials/java21/migration-guide/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java21/migration-guide/</guid><description>Why Migrate Now? Java 21 is the current Long-Term Support (LTS) release, and it is the most feature-rich LTS since Java 8. LTS releases receive security patches and bug fixes for years. Java 11, the previous widely-used LTS, reached its extended support window end depending on your vendor. Java 8 mainstream support ended in 2019.
More concretely, Java 21 brings:
Virtual Threads — drop-in replacement for platform threads, enabling massive concurrency without reactive rewrites Pattern Matching for switch and records — eliminating entire categories of verbose, error-prone instanceof/cast chains Sequenced Collections — a unified API for ordered collection types Generational ZGC — sub-millisecond GC pauses at any heap size These are not incremental improvements.</description></item><item><title>Pattern Matching for instanceof (JEP 394): Smarter Type Checks</title><link>https://devops-monk.com/tutorials/java17/pattern-matching-instanceof/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/pattern-matching-instanceof/</guid><description>Finalized in Java 16 (JEP 394). Available in all Java 16+ releases, including Java 17. Previous previews: Java 14 (JEP 305) and Java 15 (JEP 375).
The Problem: The instanceof-Cast Dance Every Java developer has written this pattern:
// Java 11 — check, then cast if (obj instanceof String) { String s = (String) obj; // cast is logically redundant System.out.println(s.toUpperCase()); } The instanceof check already verified the type. The cast on the next line is conceptually redundant — the compiler could infer that obj is a String in the if body.</description></item><item><title>Pattern Matching for switch (JEP 406): Type Dispatch in switch (Preview)</title><link>https://devops-monk.com/tutorials/java17/pattern-matching-switch-preview/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/pattern-matching-switch-preview/</guid><description>Preview Feature in Java 17 (JEP 406 — First Preview). Requires --enable-preview. This feature evolved through Java 18 (JEP 420), Java 19 (JEP 427), Java 20 (JEP 433), and was finalized in Java 21 (JEP 441). The Java 21 final version has minor syntax differences from this Java 17 preview — documented below.
Enabling Preview Features Pattern matching for switch requires --enable-preview in Java 17. Add to your build tool:</description></item><item><title>Records (JEP 395): Immutable Data Classes Without the Boilerplate</title><link>https://devops-monk.com/tutorials/java17/records/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/records/</guid><description>Finalized in Java 16 (JEP 395). Available in all Java 16+ releases, including Java 17. Previous previews: Java 14 (JEP 359) and Java 15 (JEP 384).
The Problem: Data Classes in Java Writing a simple immutable data class in Java 11 requires significant boilerplate:
public final class Point { private final int x; private final int y; public Point(int x, int y) { this.x = x; this.y = y; } public int x() { return x; } public int y() { return y; } @Override public boolean equals(Object o) { if (this == o) return true; if (!</description></item><item><title>Sealed Classes (JEP 409): Controlled, Exhaustive Class Hierarchies</title><link>https://devops-monk.com/tutorials/java17/sealed-classes/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/sealed-classes/</guid><description>Finalized in Java 17 (JEP 409). This is the headline language feature of the Java 17 LTS release. Previous previews: Java 15 (JEP 360) and Java 16 (JEP 397).
The Problem: Open Hierarchies Are Hard to Reason About In Java, any class can be extended by default. This openness is flexible but has costs.
Consider a Shape interface used in a drawing application:
// Java 11 — anyone can implement Shape public interface Shape { double area(); } At runtime, a Shape instance could be a Circle, a Rectangle, a Triangle, or anything else in the classpath.</description></item><item><title>Setting Up Java 17: JDK Options, Tooling, and IDE Configuration</title><link>https://devops-monk.com/tutorials/java17/java17-setup/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/java17-setup/</guid><description>JDK Distribution Options Multiple vendors ship Java 17 JDK builds. All pass the TCK (Technology Compatibility Kit) — they are functionally equivalent for development.
Distribution Provider Notes Eclipse Temurin Adoptium / Eclipse Recommended default; fully open-source Amazon Corretto AWS Free; optimized for AWS Lambda and EC2 Microsoft Build of OpenJDK Microsoft Windows and Azure optimized Oracle JDK 17 Oracle Free for development; commercial license for production Azul Zulu Azul Commercial support available; free binaries GraalVM CE 22.</description></item><item><title>Switch Expressions (JEP 361): Switch as an Expression, Not Just a Statement</title><link>https://devops-monk.com/tutorials/java17/switch-expressions/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/switch-expressions/</guid><description>Finalized in Java 14 (JEP 361). Available in all Java 14+ releases, including Java 17. Previous previews: Java 12 (JEP 325) and Java 13 (JEP 354).
The Problem with Switch Statements Java&amp;rsquo;s traditional switch statement has two well-known pain points:
Pain 1: Fall-Through // Java 11 — easy to introduce fall-through bugs switch (day) { case MONDAY: result = &amp;#34;Start of work week&amp;#34;; break; // easy to forget this case TUESDAY: result = &amp;#34;Weekday&amp;#34;; // no break — falls through to WEDNESDAY case case WEDNESDAY: result = &amp;#34;Hump day&amp;#34;; break; default: result = &amp;#34;Other&amp;#34;; } A missing break causes the next case to execute unexpectedly.</description></item><item><title>Text Blocks (JEP 378): Multiline Strings Without the Escape Hell</title><link>https://devops-monk.com/tutorials/java17/text-blocks/</link><pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java17/text-blocks/</guid><description>Finalized in Java 15 (JEP 378). Available in all Java 15+ releases, including Java 17. Previous previews: Java 13 (JEP 355) and Java 14 (JEP 368).
The Problem: Embedded Strings in Java Writing multi-line strings in Java has always been painful:
// JSON — a wall of escape sequences and concatenation String json = &amp;#34;{\n&amp;#34; + &amp;#34; \&amp;#34;name\&amp;#34;: \&amp;#34;Alice\&amp;#34;,\n&amp;#34; + &amp;#34; \&amp;#34;role\&amp;#34;: \&amp;#34;engineer\&amp;#34;,\n&amp;#34; + &amp;#34; \&amp;#34;active\&amp;#34;: true\n&amp;#34; + &amp;#34;}&amp;#34;; // SQL — unreadable indentation and newlines String sql = &amp;#34;SELECT u.</description></item></channel></rss>