Skip to content

19. Java 17 transition

Ilkka Seppälä edited this page Sep 26, 2022 · 23 revisions

Overview

Background Material

https://mydeveloperplanet.com/2021/09/28/whats-new-between-java-11-and-java-17/

Preparing for the Transition

  • Upgrade to the latest Maven version https://github.com/iluwatar/java-design-patterns/issues/1948
  • Update Maven plugins such as compile, surefire and failsafe to newer versions so that they support Java 17
  • Update Lombok to the latest version that supports Java 17 (see https://projectlombok.org/changelog)
  • Get rid of current compiler warnings, especially the ones that warn about deprecation
  • Run the regular build entirely on the newer JDK in a way that lets us gather all errors instead of stopping the build to the first failure
  • Build the project using the old JDK, but try to run it against a newer runtime and record the errors
  • Upgrade dependencies so that they support Java 17

Switch from JDK11 to JDK17

  • Configure Maven plugins to use Java 17 and verify that build works using JDK17
  • Update CI configuration to use JDK17

After the Transition

  • Update wiki documentation
  • Start using text blocks
  • Update switch expressions
  • Start using records
  • Start using sealed classes
  • Pattern matching for instanceof
  • Stream.toList()