From Java 11 to Java 17
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.
Table of Contents
-
1 Introduction
- 1.1 Java Releases Schedule 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
-
5.1 Pattern Matching for
-
6 Text Blocks
- 6.1 Text Blocks
- 6.2 Re-indentation
- 6.3 Escape Sequences
- 6.4 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
-
7.1 JFR Event Streaming
-
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
-
12.1 Foreign Memory
-
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
-
13.1 Deprecated
-
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
Other books by this author
The Leanpub 60-day 100% Happiness Guarantee
Within 60 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$11,577,045writing, 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
Top Books
Recipes for Decoupling
Matthias NobackSignalR on .NET 6 - the Complete Guide
Fiodar SazanavetsLearn everything there is to learn about SignalR and how to integrate it with the latest .NET 6 and C# 10 features. Learn how to connect any type of client to SignalR, including plain WebSocket client. Learn how to build interactive applications that can communicate with each other in real time without making excessive calls.
The BDD Books - Discovery (Japanese Edition)
Gáspár Nagy, Seb Rose, and Yuya Kazamaウクライナ難民を支援 - 2022年5月末まで延長!
この本の売り上げの50%は、 https://unicef.hu/veszhelyzet-ukrajnaban と https://int.depaulcharity.org/fundraising-for-depaul-ukraine/ に寄付されます。
本書籍は、振る舞い駆動開発(Behavior Driven Development, BDD)や受け入れテスト駆動開発(Acceptance Test-Driven Development, ATDD)の発見フェーズを最大限に活用する方法を提供します。
The easiest way to learn design patterns
Fiodar SazanavetsLearn design patterns in the easiest way possible. You will no longer have to brute-force your way through each one of them while trying to figure out how it works. The book provides a unique methodology that will make your understanding of design patterns stick. It can also be used as a reference book where you can find design patterns in seconds.
Agile Testing Condensed Japanese Edition
Yuya Kazama, Janet Gregory, and Lisa CrispinJanet GregoryとLisa Crispinによる2019年9月発行の書籍『Agile Testing Condensed』の日本語翻訳版です。アジャイルにおいてどのような考えでテストを行うべきなのか簡潔に書かれています!
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
Tech Giants in Healthcare
Dr. Bertalan MeskoThis comprehensive guide, Tech Giants in Healthcare, clarifies how and why big tech companies step into healthcare, and breaks it down from one market player to the other in what direction they are going, what tools they are using and what horizons they have in front of them.
Functional event-driven architecture: Powered by Scala 3
Gabriel VolpeExplore the event-driven architecture (EDA) in a purely functional way, mainly powered by Fs2 streams in Scala 3!
Leverage your functional programming skills by designing and writing stateless microservices that scale, powered by stateful message brokers.
CCIE Service Provider Version 4 Written and Lab Exam Comprehensive Guide
Nicholas RussoThe service provider landscape has changed rapidly over the past several years. Networking vendors are continuing to propose new standards, techniques, and procedures for overcoming new challenges while concurrently reducing costs and delivering new services. Cisco has recently updated the CCIE Service Provider track to reflect these changes; this book represents the author's personal journey in achieving that certification.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Top Bundles
- #1
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #2
Practical FP in Scala + Functional event-driven architecture
2 Books
Practical FP in Scala (A hands-on approach) & Functional event-driven architecture, aka FEDA, (Powered by Scala 3), together as a bundle! The content of PFP in Scala is a requirement to understand FEDA so why not take advantage of this bundle!? - #3
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #4
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #6
Pattern-Oriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible... - #8
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also...