From Java 11 to Java 17
$7.99
Minimum price
$9.99
Suggested price

From Java 11 to Java 17

Upgrade to Next Java LTS Version

About the Book

Java 17 is the next LTS version of Java. LTS means long-term support. Java 17 should be the next version to upgrade. It is expected that users of Java 11 will gradually migrate to Java 17.

This book covers major changes from Java 11 to Java 17. Below is a list of these features:

  • Records
  • Sealed classes
  • Switch expressions
  • Pattern matching
  • Text blocks
  • JFR event streaming, JVM constants API, hidden classes
  • Changes to Java standard libraries
  • New garbage collectors
  • Changes to JVM
  • Packaging tool - jpackage
  • Foreign function & memory API
  • Other changes

If you are using Java 11 and planning to upgrade to Java 17, this book can provide you with a valuable reference.

About the Author

Fu Cheng
Fu Cheng

Full-stack software developer and lead software engineer at a healthcare startup.

  • Understanding the Java 7: the Core techniques and best practice (Simplified Chinese edition) covers Java SE 7 new features and deep dive of Java platform core features.
  • Build Mobile Apps with Ionic 2 and Firebase covers building mobile apps using Ionic 2 and Firebase.
  • Exploring Java 9 covers Java 9 module system and other new features.
  • A regular author on IBM developerWorks China and InfoQ China website with more than 50 published technical articles covering various technical topics.

Table of Contents

  • 1 Introduction
    • 1.1 Java Releases After Java 9
    • 1.2 JEPs in Different Java Releases
      • 1.2.1 Java 12
      • 1.2.2 Java 13
      • 1.2.3 Java 14
      • 1.2.4 Java 15
      • 1.2.5 Java 16
      • 1.2.6 Java 17
    • 1.3 Install Java 17
    • 1.4 Source Code
  • 2 Records
    • 2.1 Value Objects
    • 2.2 Alternatives
      • 2.2.1 Lombok
      • 2.2.2 Kotlin Data Class
      • 2.2.3 Scala Case Class
    • 2.3 Use Records
      • 2.3.1 Constructors
      • 2.3.2 Nested Records
      • 2.3.3 Local Records
      • 2.3.4 Record class
  • 3 Sealed Classes
    • 3.1 Inheritance in Java
    • 3.2 Sealed Classes
    • 3.3 Sealed Interfaces
    • 3.4 Sealed and Record Classes
    • 3.5 Reflection API
    • 3.6 Class File Changes
  • 4 Switch Expressions
    • 4.1 Problems with switch Statement
    • 4.2 Switch Expression
    • 4.3 Arrow Labels
  • 5 Pattern Matching
    • 5.1 Pattern Matching for instanceof
    • 5.2 Pattern Matching for switch
  • 6 Text Blocks
    • 6.1 Re-indentation
    • 6.2 Escape Sequences
    • 6.3 New String Methods
  • 7 Low-level APIs
    • 7.1 JFR Event Streaming
      • 7.1.1 Event Stream
      • 7.1.2 Event
      • 7.1.3 Example
    • 7.2 JVM Constants API
      • 7.2.1 Loadable Constants
      • 7.2.2 Constants API
    • 7.3 Hidden Classes
      • 7.3.1 Names of Hidden Classes
      • 7.3.2 Create Hidden Classes
      • 7.3.3 Class Loading of Hidden Classes
      • 7.3.4 Unloading of Hidden Classes
      • 7.3.5 Stack Traces
      • 7.3.6 Nest-based Access Control
  • 8 Standard Libraries
    • 8.1 Unix-Domain Socket Channels
    • 8.2 Reimplement the Legacy Socket API
    • 8.3 Reimplement the Legacy DatagramSocket API
    • 8.4 Enhanced Pseudo-Random Number Generators
    • 8.5 New macOS Rendering Pipeline
    • 8.6 Edwards-Curve Digital Signature Algorithm (EdDSA)
    • 8.7 Context-Specific Deserialization Filters
  • 9 JVM
    • 9.1 Class-Data Sharing
    • 9.2 Helpful NullPointExceptions
    • 9.3 Elastic Metaspace
    • 9.4 Deprecate and Disable Biased Locking
  • 10 Packaging Tool
    • 10.1 Use jpackage
    • 10.2 Custom Runtime Image
      • 10.2.1 Use jdeps
      • 10.2.2 Use jlink
      • 10.2.3 Create Package
  • 11 Garbage Collectors
    • 11.1 ZGC
    • 11.2 Shenandoah
    • 11.3 Deprecated GC
    • 11.4 Removed GC
    • 11.5 Updates to G1
      • 11.5.1 Abortable Mixed Collections for G1
      • 11.5.2 Promptly Return Unused Committed Memory from G1
      • 11.5.3 NUMA-Aware Memory Allocation for G1
  • 12 Foreign Function & Memory API
    • 12.1 Foreign Memory
      • 12.1.1 Memory Segments
      • 12.1.2 Dereferencing Memory Segments
      • 12.1.3 Memory Layouts
      • 12.1.4 Resource Scopes
      • 12.1.5 Cleaner
    • 12.2 Foreign Functions
      • 12.2.1 Downcall - Call from Java to Native
      • 12.2.2 Upcall - Call From Native To Java
  • 13 Deprecated & Removed Features
    • 13.1 Deprecated
      • 13.1.1 Applet API
      • 13.1.2 Security Manager
    • 13.2 Removed
      • 13.2.1 Experimental AOT and JIT Compiler
      • 13.2.2 RMI Activation
      • 13.2.3 Pack200 Tools
      • 13.2.4 Nashorn JavaScript Engine
      • 13.2.5 Solaris and SPARC Ports
  • 14 Misc.
    • 14.1 Restore Always-Strict Floating-Point Semantics
    • 14.2 macOS/AArch64 Port
    • 14.3 Alpine Linux Port
    • 14.4 Strongly Encapsulate JDK Internals
    • 14.5 Migrate to GitHub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$10,913,181writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF, EPUB and/or MOBI files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub