MAKING THE
MOVE TO
JAVA 17
ALEX MOTLEY
@alexsmotley
CINDY HIGH
@CTHigh
ABOUT US
Alex Motley
Alex is a software engineer at IBM leading the WebSphere Application
Server migration tools team. His team develops several migration tools to
help with a variety of modernization scenarios including WebSphere
traditional to Liberty, Java SE and EE versions, and on-premise to cloud.
He has almost a decade of experience working with Java EE and Java
application server technology. Alex enjoys hiking and skiing and lives in
Rochester, MN.
Cindy High
Cindy is a software engineer with IBM and is the WebSphere Application
Server migration tools architect focusing on application modernization and
configuration migration. She has worked over 20 years with Java EE and
application server technology. The tools we developed over the years for
WebSphere can help you migrate your applications easier! Cindy enjoys
biking and working on stained glass projects and lives in Raleigh, NC.
MAKING THE
MOVE TO
JAVA 17
WHY
MIGRATE?
WHY MIGRATE?
Lots of new features!
Feature Lists ( JDK 11, JDK 12, JDK 13,
JDK 14, JDK 15, JDK 16, JDK 17)
WHY MIGRATE? - NEW JAVA 11 FEATURES
§ var for local variables (JEP 286)
§ New methods in classes (Collection, etc) (JEP 269)
- List<String> myList = ArrayList<String>();
- myList.add(“Georgia”);
- myList.add(“Minnesota”);
- myList.add(“Texas”);
- myList = Collections.unmodifiableList(myList);
+ var myList = List.of(“Georgia”, “Minnesota”, “Texas”);
WHY MIGRATE? - NEW JAVA 17 FEATURES
Text Blocks (JEP 378)
- String output = "Now you can moren" +
- "easily write Stringsn" +
- "that span multiple lines.";
+ String output = """
+ Now you can more
+ easily write Strings
+ that span multiple lines.""";
WHY MIGRATE? - NEW JAVA 17 FEATURES
Helpful NullPointerExceptions (JEP 358)
- Exception in thread "main" java.lang.NullPointerException
- at ...
+ Exception in thread "main" java.lang.NullPointerException:
+ Cannot invoke "String.concat(String)" because "MyClass.coffee"
+ is null
+ at ...
WHY MIGRATE? - NEW JAVA 17 FEATURES
Records (JEP 395)
- public class Car {
- private final String color;
- private final String make;
- private final String model;
-
- public Car(String color, String make, String model) {
- this.color = color;
- this.make = make;
- this.model = model;
- }
-
- // Getters for color, make, model
- // equals, toString, and hashCode methods
- }
+ public record Car (String color, String make, String model) {}
WHY MIGRATE? - NEW JAVA 17 FEATURES
Switch enhancements (JEP 361, JEP 406)
- String result = "";
- switch (day) {
- case MONDAY:
- case TUESDAY:
- case WEDNESDAY:
- case THURSDAY:
- case FRIDAY:
- result = "Weekday";
- break;
- case SATURDAY:
- case SUNDAY:
- result = "Weekend";
- break;
- default:
- throw new IllegalStateException("Unknown day: " + day);
- }
+ var result = switch (day) {
+ case MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY -> "Weekday";
+ case SATURDAY, SUNDAY -> "Weekend";
+ default -> throw new IllegalStateException("Unknown day: " + day);
+ };
WHY MIGRATE? - NEW JAVA 17 FEATURES
§ instanceof Pattern Matching (JEP 394)
- if (sport instanceof Baseball) {
- Baseball baseball = (Baseball) sport;
- baseball.pitch();
- }
+ if (sport instanceof Baseball baseball) {
+ baseball.pitch();
+ }
WHY MIGRATE?
Security Related
Changes
¡ Crypto
¡ With Applet support removed,
Security Manager deprecated
for removal
¡ Strongly Encapsulated JDK
Internals (JEP 403)
¡ Sealed classes (JEP 409)
¡ Hidden classes (JEP 371)
WHY MIGRATE?
Library/tooling
developers need to
keep up
WHY MIGRATE?
…and of course: Java
8 and 11 will EOL
MAKING THE
MOVE TO
JAVA 17
WHAT IS MY
TARGET JAVA
VERSION?
JAVA TIMELINE
Java 11 (LTS)
Sept
2018
LTS: Long Term Support - Production
2016 2017 2018 2019 2021
2020 2022 2023 2024 2025
Java 9
Java 10
Java 12
Java 13
Java 14
Java 15
Java 16
Java 7
Sept
2021
Java 18
Java 19
Java 20
Sept
2023
Continuous testing with non-LTS releases
Java 17 (LTS) 2027
Java 21 (LTS)
Java 8 (LTS) 2026
MAKING THE
MOVE TO
JAVA 17
WHAT ARE THE
TOP MIGRATION
ISSUES FOR
JAVA 8/11 à JAVA
17+?
Top
Migration
Issues
Missing Libraries
Removed APIs
Modularity & Strong Encapsulation
Out-of-date Dependencies
java.activation
javax.activation
java.corba
javax.rmi
javax.rmi.CORBA
org.omg.CORBA
org.omg.CORBA_2_3
org.omg.CORBA_2_3.portable
...
org.omg.PortableServer
org.omg.PortableServer.*
org.omg.SendingContext
org.omg.stub.java.rmi
java.transaction
javax.transaction
java.xml.bind
javax.xml.bind
javax.xml.bind.annotation
javax.xml.bind.annotation.adapte
javax.xml.bind.attachment
javax.xml.bind.helpers
javax.xml.bind.util
java.xml.ws
javax.jws
javax.jws.soap
javax.xml.soap
javax.xml.ws
javax.xml.ws.handler
javax.xml.ws.handler.soap
javax.xml.ws.http
javax.xml.ws.soap
javax.xml.ws.spi
javax.xml.ws.spi.http
javax.xml.ws.wsaddressing
java.xml.ws.annotation
javax.annotation
Java 11+ (Java EE)
(Most problematic for us)
Option 1: Package your own dependencies
Option 2: Rely on the app server to provide them (Open Liberty with Java 11+)
JAX-B
JAX-WS Common Annotations
JTA
Corba
JAF
JAVA 11 +
Java Web Start
github.com/openjdk/nashorn
JavaFX
openwebstart.com
openjfx.io
JAVA 17 +
Nashorn JavaScript Engine
Java 11+: Java EE
(Checkout jakarta.ee)
Top
Migration
Issues
Missing Libraries
Removed APIs
Modularity & Strong Encapsulation
Out-of-date Dependencies
JAVA 11
§ com.sun.awt.AWTUtilities
§ com.sun.image.codec.jpeg.*
§ com.sun.java.browser.plugin2.DOM
§ com.sun.security.auth.callback.DialogCallbackHandler
§ com.sun.security.auth.module.SolarisLoginModule
§ com.sun.security.auth.module.SolarisSystem
§ com.sun.security.auth.PolicyFile
§ com.sun.security.auth.SolarisNumericGroupPrincipal
§ com.sun.security.auth.SolarisNumericUserPrincipal
§ com.sun.security.auth.SolarisPrincipal
§ com.sun.security.auth.X500Principal
Removed Packages/Classes
- com.sun.security.auth.SolarisNumericGroupPrincipal principal
+ com.sun.security.auth.UnixNumericGroupPrincipal principal
JAVA 11
§ com.sun.xml.internal.bind.*
§ java.awt.dnd.peer.*
§ java.awt.peer.*
§ javax.security.auth.Policy
§ sun.misc.BASE64Decoder
§ sun.misc.BASE64Encoder
§ sun.misc.Unsafe.defineClass
§ sun.plugin.dom.DOMObject
Removed Packages/Classes
- if(button.getPeer() != null) {
+ if(button.isDisplayable()) {
JAVA 11
§ java.lang.Runtime.getLocalizedInputStream(..)
§ java.lang.Runtime.getLocalizedOutputStream(..)
§ java.lang.Runtime.runFinalizersOnExit(..)
§ java.lang.SecurityManager.checkAwtEventQueueAccess()
§ java.lang.SecurityManager.checkMemberAccess(..)
§ java.lang.SecurityManager.checkSystemClipboardAccess()
§ java.lang.SecurityManager.checkTopLevelWindow(..)
§ java.lang.SecurityManager.classDepth(..)
§ java.lang.SecurityManager.classLoaderDepth()
§ java.lang.SecurityManager.currentClassLoader()
§ java.lang.SecurityManager.currentLoadedClass()
§ java.lang.SecurityManager.getInCheck()
§ java.lang.SecurityManager.inClass(..)
§ java.lang.SecurityManager.inClassLoader()
Removed Methods
- securityManager.checkAwtEventQueueAccess();
+ securityManager.checkPermission(permission);
JAVA 11
§ java.lang.System.runFinalizersOnExit(..)
§ java.lang.Thread.destroy()
§ java.lang.Thread.stop(java.lang.Throwable)
§ java.util.jar.Pack200.Packer.addPropertyChangeListener(..)
§ java.util.jar.Pack200.Packer.removePropertyChangeListener(..)
§ java.util.jar.Pack200.Unpacker.addPropertyChangeListener(..)
§ java.util.jar.Pack200.Unpacker.removePropertyChangeListener(..)
§ java.util.logging.LogManager.addPropertyChangeListener(..)
§ java.util.logging.LogManager.removePropertyChangeListener(..)
Removed Methods
“Finalizers are inherently problematic, and
their use can lead to performance issues,
deadlocks, hangs, and other problematic
behavior.” - JDK-8165641
JAVA 17
§ com.sun.awt.SecurityWarning
§ java.security.acl.*
§ java.util.jar.Pack200*
§ jdk.net.SocketFlow*
§ java.rmi.activation*
Removed Packages/Classes
§ java.management.rmi.RMIConnectorServer.CREDENTIAL_TYPES
Removed Constants
JAVA 17
§ java.io.FileInputStream.finalize()
§ java.io.FileOutputStream.finalize()
§ java.lang.Runtime.traceInstructions(boolean)
§ java.lang.Runtime.traceMethodCalls(boolean)
§ java.util.zip.ZipFile.finalize()
§ java.util.zip.Inflater.finalize()
§ java.util.zip.Deflater.finalize()
§ netscape.javascript.JSObject.getWindow(Applet)
§ sun.misc.Unsafe.defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches)
§ javax.net.ssl.SSLSession.getPeerCertificateChain()**
§ java.lang.thread.countStackFrames()**
Removed Methods
§ javax.tools.ToolProvider()
§ java.lang.invoke.ConstantBootstraps()
§ java.lang.relect.Modifier()
Removed Constructors
**APIs now throw UnsupportedOperationException
- javax.net.ssl.SSLSession.getPeerCerficateChain();
+ javax.net.ssl.SSLSession.getPeerCerficates();
Top
Migration
Issues
Missing Libraries
Removed APIs
Modularity & Strong Encapsulation
Out-of-date Dependencies
§ Breaks code into modules containing packages
§ Applications must declare dependency on modules for access
§ Disruptive for Java SE application migrations
Java Platform Module
System (JPMS)
§ Use JDeps or --illegal-access=warn|debug
Use find issues in your
application
§ Use --illegal-access=permit
If migrating to Java 11
§ --add-opens launcher option
§ Add-Opens jar Manifest Attribute
If migrating to Java 17+
MODULARITY
Top
Migration
Issues
Missing Libraries
Removed APIs
Modularity & Strong Encapsulation
Out-of-date Dependencies
OUT-OF-DATE DEPENDENCIES
Libraries (ASM, Mockito, Spring, Spring Boot, etc)
Build Tools (Maven, Gradle, etc)
IDE (Eclipse, IntelliJ, VS Code, etc)
Application servers (Open Liberty, JBoss, WebLogic, etc)
My advice: take this time to upgrade your dependencies to the latest supported version. Setup automation tools.
MAKING THE
MOVE TO
JAVA 17
WHAT ABOUT
DEPRECATIONS?
KEEP AN EYE ON DEPRECATIONS
§ Java RMI Activation
§ Thread.destroy() and Thread.stop(Throwable t)
Some recently removed deprecations include:
§ Java Security Manager
§ Primitive wrapper class constructors
Some APIs currently deprecated for removal:
Full list: https://docs.oracle.com/en/java/javase/17/docs/api/deprecated-list.html#for-removal
MAKING THE
MOVE TO
JAVA 17
WHAT TOOLS CAN I
USE TO MAKE MY
MIGRATION
EASIER?
USE CONTAINERS
TO STAY UP TO
DATE
¡ Use containers to
easily keep your
Java versions up to
date
¡ This can be used to
ensure you stay up
to date with the
latest fix packs, as
well as test out
new Java versions
Application Binary
Scanner Tool
§ Download:
ibm.biz/WAMT4AppBi
naries or Maven
§ Command line tool
(free personal and
commercial use)
§ Scans an application
binary for migration
issues and produces a
report with identified
problems, solutions
and resource links
§ Documentation
JDeps
§ Command utility
shipped with JDK (run
with the target Java
version – Java 11+)
§ Migration Relevant
Option: -jdkinternals
§ Binary scanner will
recommend running
JDeps if it identifies
internal APIs
§ Documentation
Tools to automate
dependency updates
(various options)
§ Use an auto-upgrade
dependency tool to
keep your
dependencies up-to-
date
§ Configure the tools to
update based on
various settings
(frequency, etc)
§ Example: Dependabot
Eclipse Transformer
§ Transform application
binaries or source code
to use the new
package names in
Jakarta EE 9+
§ Documentation
TOOLS
DEMO
NEXT STEPS
Step 1
Evaluate your
applications
using the tools.
Step 2
Try running
your
application on
Java 17. If your
app runs
successfully,
you can skip the
next two steps.
Step 3
Debug and fix
your
application
code or build
files. Repeat
steps 1-3.
Step 4
Update your
dependencies
and tools as
needed.
Step 5
Run all your
application
tests.
Step 6
Celebrate!
HELPFUL LINKS
¡ Our blog on adding the Java 17 feature to the migration tools (written instructions on running binary
scanner): https://developer.ibm.com/tutorials/migration-to-java-11-made-easy/
¡ Binary Scanner and Eclipse IDE Plugin Source Scanner downloads: ibm.biz/wamtdownloads
§ Documentation: https://www.ibm.com/docs/wamt
¡ Link to the java17demo GitHub repo: https://github.com/alexsm82/java17demo
¡ Oracle Java SE Support Roadmap: https://www.oracle.com/java/technologies/java-se-support-
roadmap.html
¡ Java Version Almanac: https://javaalmanac.io/
¡ Andy Guibert’s blog on OpenLiberty Java 11+ support: https://openliberty.io/blog/2019/02/06/java-
11.html
¡ Blog on running the binary scanner with Maven:
https://community.ibm.com/community/user/wasdevops/blogs/alex-
motley1/2022/04/12/applications-pipelines-and-migrations
IBM SESSIONS
¡ Tuesday 10:00AM Fast JVM Startup with Checkpoint and Restore –
Tobi Ajila | JVM Platform
¡ Tuesday 2:15PM Better, Stronger, Faster Java in the Cloud - Jarek
Gawor and Tobi Ajila |Main Room (Java)
¡ 3:15 Book signing – Cloud Native Application Development with
MicroProfile and Open Liberty and Birthday Cake
¡ Wednesday 10:00AM Making the Move to Java 17 – Alex Motley and
Cindy High | Main Room (Java)
¡ Wednesday 1:15PM Relook at Microservices – Emily Jiang | Main Room
(Java)
QUESTIONS?
@alexsmotley
@CTHigh

More Related Content

PDF
Deep Dive Java 17 Devoxx UK
PPTX
Discover Quarkus and GraalVM
PDF
Spring Boot 3 And Beyond
PDF
Quarkus - a next-generation Kubernetes Native Java framework
PDF
From Java 11 to 17 and beyond.pdf
PDF
Spring Boot Interview Questions PDF By ScholarHat
PDF
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
PDF
JavaOne 2013: Memory Efficient Java
Deep Dive Java 17 Devoxx UK
Discover Quarkus and GraalVM
Spring Boot 3 And Beyond
Quarkus - a next-generation Kubernetes Native Java framework
From Java 11 to 17 and beyond.pdf
Spring Boot Interview Questions PDF By ScholarHat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
JavaOne 2013: Memory Efficient Java

What's hot (20)

ODP
Java 9 Features
PPTX
Java Spring Framework
PPT
Spring Boot in Action
PPTX
Spring boot
PPTX
What's new in Java 11
PDF
spring-api-rest.pdf
PDF
Service discovery with Eureka and Spring Cloud
PDF
Spring Data JPA
PDF
Testing with JUnit 5 and Spring
PDF
Java11 New Features
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
PDF
Spring core module
PDF
Introduction to Java 11
PPTX
Introduce yourself to java 17
PPTX
Reactive programming
PDF
Zeppelin(제플린) 서울시립대학교 데이터 마이닝연구실 활용사례
PDF
Upgrade to java 16 or 17
PDF
Spring boot jpa
PPTX
Java 11 to 17 : What's new !?
PDF
Spring Framework - Core
Java 9 Features
Java Spring Framework
Spring Boot in Action
Spring boot
What's new in Java 11
spring-api-rest.pdf
Service discovery with Eureka and Spring Cloud
Spring Data JPA
Testing with JUnit 5 and Spring
Java11 New Features
Understanding MicroSERVICE Architecture with Java & Spring Boot
Spring core module
Introduction to Java 11
Introduce yourself to java 17
Reactive programming
Zeppelin(제플린) 서울시립대학교 데이터 마이닝연구실 활용사례
Upgrade to java 16 or 17
Spring boot jpa
Java 11 to 17 : What's new !?
Spring Framework - Core
Ad

Similar to Making The Move To Java 17 (JConf 2022) (20)

PPTX
Modern_Java_Workshop manjunath np hj slave
PPTX
Modern Java Workshop
PPTX
Getting the Most From Modern Java
PPT
Java user group 2015 02-09-java8
PPT
Java user group 2015 02-09-java8
PDF
Migrate Early, Migrate Often: JDK release cadence strategies
PDF
Java features. Java 8, 9, 10, 11
PPTX
Java 7 & 8 New Features
PDF
Migrating Beyond Java 8
PPTX
Keeping Up with Java: Look at All These New Features!
PPTX
core_java_50_slides_thread_collections_p
PDF
engage 2016 - Get ready for moving from Java 6 to Java 8 - Now!
PDF
Java 17
PDF
Jakarta EE 8 on JDK17
PDF
Alive and Well with Java 8
PDF
Migrating Beyond Java 8
PPT
Jug java7
PPT
Java SE 7 New Features and Enhancements
PDF
Terence Barr - jdk7+8 - 24mai2011
PDF
What to expect from Java 9
Modern_Java_Workshop manjunath np hj slave
Modern Java Workshop
Getting the Most From Modern Java
Java user group 2015 02-09-java8
Java user group 2015 02-09-java8
Migrate Early, Migrate Often: JDK release cadence strategies
Java features. Java 8, 9, 10, 11
Java 7 & 8 New Features
Migrating Beyond Java 8
Keeping Up with Java: Look at All These New Features!
core_java_50_slides_thread_collections_p
engage 2016 - Get ready for moving from Java 6 to Java 8 - Now!
Java 17
Jakarta EE 8 on JDK17
Alive and Well with Java 8
Migrating Beyond Java 8
Jug java7
Java SE 7 New Features and Enhancements
Terence Barr - jdk7+8 - 24mai2011
What to expect from Java 9
Ad

Recently uploaded (20)

PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
GSA Content Generator Crack (2025 Latest)
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PPTX
Cybersecurity: Protecting the Digital World
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Time Tracking Features That Teams and Organizations Actually Need
PDF
Website Design Services for Small Businesses.pdf
PPTX
assetexplorer- product-overview - presentation
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Types of Token_ From Utility to Security.pdf
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PPTX
Computer Software - Technology and Livelihood Education
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
CNN LeNet5 Architecture: Neural Networks
Topaz Photo AI Crack New Download (Latest 2025)
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
GSA Content Generator Crack (2025 Latest)
How to Use SharePoint as an ISO-Compliant Document Management System
Cybersecurity: Protecting the Digital World
Monitoring Stack: Grafana, Loki & Promtail
Time Tracking Features That Teams and Organizations Actually Need
Website Design Services for Small Businesses.pdf
assetexplorer- product-overview - presentation
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
MCP Security Tutorial - Beginner to Advanced
Types of Token_ From Utility to Security.pdf
Wondershare Recoverit Full Crack New Version (Latest 2025)
iTop VPN Crack Latest Version Full Key 2025
DNT Brochure 2025 – ISV Solutions @ D365
Computer Software - Technology and Livelihood Education
Computer Software and OS of computer science of grade 11.pptx
Why Generative AI is the Future of Content, Code & Creativity?
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
CNN LeNet5 Architecture: Neural Networks

Making The Move To Java 17 (JConf 2022)

  • 1. MAKING THE MOVE TO JAVA 17 ALEX MOTLEY @alexsmotley CINDY HIGH @CTHigh
  • 2. ABOUT US Alex Motley Alex is a software engineer at IBM leading the WebSphere Application Server migration tools team. His team develops several migration tools to help with a variety of modernization scenarios including WebSphere traditional to Liberty, Java SE and EE versions, and on-premise to cloud. He has almost a decade of experience working with Java EE and Java application server technology. Alex enjoys hiking and skiing and lives in Rochester, MN. Cindy High Cindy is a software engineer with IBM and is the WebSphere Application Server migration tools architect focusing on application modernization and configuration migration. She has worked over 20 years with Java EE and application server technology. The tools we developed over the years for WebSphere can help you migrate your applications easier! Cindy enjoys biking and working on stained glass projects and lives in Raleigh, NC.
  • 3. MAKING THE MOVE TO JAVA 17 WHY MIGRATE?
  • 4. WHY MIGRATE? Lots of new features! Feature Lists ( JDK 11, JDK 12, JDK 13, JDK 14, JDK 15, JDK 16, JDK 17)
  • 5. WHY MIGRATE? - NEW JAVA 11 FEATURES § var for local variables (JEP 286) § New methods in classes (Collection, etc) (JEP 269) - List<String> myList = ArrayList<String>(); - myList.add(“Georgia”); - myList.add(“Minnesota”); - myList.add(“Texas”); - myList = Collections.unmodifiableList(myList); + var myList = List.of(“Georgia”, “Minnesota”, “Texas”);
  • 6. WHY MIGRATE? - NEW JAVA 17 FEATURES Text Blocks (JEP 378) - String output = "Now you can moren" + - "easily write Stringsn" + - "that span multiple lines."; + String output = """ + Now you can more + easily write Strings + that span multiple lines.""";
  • 7. WHY MIGRATE? - NEW JAVA 17 FEATURES Helpful NullPointerExceptions (JEP 358) - Exception in thread "main" java.lang.NullPointerException - at ... + Exception in thread "main" java.lang.NullPointerException: + Cannot invoke "String.concat(String)" because "MyClass.coffee" + is null + at ...
  • 8. WHY MIGRATE? - NEW JAVA 17 FEATURES Records (JEP 395) - public class Car { - private final String color; - private final String make; - private final String model; - - public Car(String color, String make, String model) { - this.color = color; - this.make = make; - this.model = model; - } - - // Getters for color, make, model - // equals, toString, and hashCode methods - } + public record Car (String color, String make, String model) {}
  • 9. WHY MIGRATE? - NEW JAVA 17 FEATURES Switch enhancements (JEP 361, JEP 406) - String result = ""; - switch (day) { - case MONDAY: - case TUESDAY: - case WEDNESDAY: - case THURSDAY: - case FRIDAY: - result = "Weekday"; - break; - case SATURDAY: - case SUNDAY: - result = "Weekend"; - break; - default: - throw new IllegalStateException("Unknown day: " + day); - } + var result = switch (day) { + case MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY -> "Weekday"; + case SATURDAY, SUNDAY -> "Weekend"; + default -> throw new IllegalStateException("Unknown day: " + day); + };
  • 10. WHY MIGRATE? - NEW JAVA 17 FEATURES § instanceof Pattern Matching (JEP 394) - if (sport instanceof Baseball) { - Baseball baseball = (Baseball) sport; - baseball.pitch(); - } + if (sport instanceof Baseball baseball) { + baseball.pitch(); + }
  • 11. WHY MIGRATE? Security Related Changes ¡ Crypto ¡ With Applet support removed, Security Manager deprecated for removal ¡ Strongly Encapsulated JDK Internals (JEP 403) ¡ Sealed classes (JEP 409) ¡ Hidden classes (JEP 371)
  • 13. WHY MIGRATE? …and of course: Java 8 and 11 will EOL
  • 14. MAKING THE MOVE TO JAVA 17 WHAT IS MY TARGET JAVA VERSION?
  • 15. JAVA TIMELINE Java 11 (LTS) Sept 2018 LTS: Long Term Support - Production 2016 2017 2018 2019 2021 2020 2022 2023 2024 2025 Java 9 Java 10 Java 12 Java 13 Java 14 Java 15 Java 16 Java 7 Sept 2021 Java 18 Java 19 Java 20 Sept 2023 Continuous testing with non-LTS releases Java 17 (LTS) 2027 Java 21 (LTS) Java 8 (LTS) 2026
  • 16. MAKING THE MOVE TO JAVA 17 WHAT ARE THE TOP MIGRATION ISSUES FOR JAVA 8/11 à JAVA 17+?
  • 17. Top Migration Issues Missing Libraries Removed APIs Modularity & Strong Encapsulation Out-of-date Dependencies
  • 18. java.activation javax.activation java.corba javax.rmi javax.rmi.CORBA org.omg.CORBA org.omg.CORBA_2_3 org.omg.CORBA_2_3.portable ... org.omg.PortableServer org.omg.PortableServer.* org.omg.SendingContext org.omg.stub.java.rmi java.transaction javax.transaction java.xml.bind javax.xml.bind javax.xml.bind.annotation javax.xml.bind.annotation.adapte javax.xml.bind.attachment javax.xml.bind.helpers javax.xml.bind.util java.xml.ws javax.jws javax.jws.soap javax.xml.soap javax.xml.ws javax.xml.ws.handler javax.xml.ws.handler.soap javax.xml.ws.http javax.xml.ws.soap javax.xml.ws.spi javax.xml.ws.spi.http javax.xml.ws.wsaddressing java.xml.ws.annotation javax.annotation Java 11+ (Java EE) (Most problematic for us) Option 1: Package your own dependencies Option 2: Rely on the app server to provide them (Open Liberty with Java 11+) JAX-B JAX-WS Common Annotations JTA Corba JAF
  • 19. JAVA 11 + Java Web Start github.com/openjdk/nashorn JavaFX openwebstart.com openjfx.io JAVA 17 + Nashorn JavaScript Engine
  • 20. Java 11+: Java EE (Checkout jakarta.ee)
  • 21. Top Migration Issues Missing Libraries Removed APIs Modularity & Strong Encapsulation Out-of-date Dependencies
  • 22. JAVA 11 § com.sun.awt.AWTUtilities § com.sun.image.codec.jpeg.* § com.sun.java.browser.plugin2.DOM § com.sun.security.auth.callback.DialogCallbackHandler § com.sun.security.auth.module.SolarisLoginModule § com.sun.security.auth.module.SolarisSystem § com.sun.security.auth.PolicyFile § com.sun.security.auth.SolarisNumericGroupPrincipal § com.sun.security.auth.SolarisNumericUserPrincipal § com.sun.security.auth.SolarisPrincipal § com.sun.security.auth.X500Principal Removed Packages/Classes - com.sun.security.auth.SolarisNumericGroupPrincipal principal + com.sun.security.auth.UnixNumericGroupPrincipal principal
  • 23. JAVA 11 § com.sun.xml.internal.bind.* § java.awt.dnd.peer.* § java.awt.peer.* § javax.security.auth.Policy § sun.misc.BASE64Decoder § sun.misc.BASE64Encoder § sun.misc.Unsafe.defineClass § sun.plugin.dom.DOMObject Removed Packages/Classes - if(button.getPeer() != null) { + if(button.isDisplayable()) {
  • 24. JAVA 11 § java.lang.Runtime.getLocalizedInputStream(..) § java.lang.Runtime.getLocalizedOutputStream(..) § java.lang.Runtime.runFinalizersOnExit(..) § java.lang.SecurityManager.checkAwtEventQueueAccess() § java.lang.SecurityManager.checkMemberAccess(..) § java.lang.SecurityManager.checkSystemClipboardAccess() § java.lang.SecurityManager.checkTopLevelWindow(..) § java.lang.SecurityManager.classDepth(..) § java.lang.SecurityManager.classLoaderDepth() § java.lang.SecurityManager.currentClassLoader() § java.lang.SecurityManager.currentLoadedClass() § java.lang.SecurityManager.getInCheck() § java.lang.SecurityManager.inClass(..) § java.lang.SecurityManager.inClassLoader() Removed Methods - securityManager.checkAwtEventQueueAccess(); + securityManager.checkPermission(permission);
  • 25. JAVA 11 § java.lang.System.runFinalizersOnExit(..) § java.lang.Thread.destroy() § java.lang.Thread.stop(java.lang.Throwable) § java.util.jar.Pack200.Packer.addPropertyChangeListener(..) § java.util.jar.Pack200.Packer.removePropertyChangeListener(..) § java.util.jar.Pack200.Unpacker.addPropertyChangeListener(..) § java.util.jar.Pack200.Unpacker.removePropertyChangeListener(..) § java.util.logging.LogManager.addPropertyChangeListener(..) § java.util.logging.LogManager.removePropertyChangeListener(..) Removed Methods “Finalizers are inherently problematic, and their use can lead to performance issues, deadlocks, hangs, and other problematic behavior.” - JDK-8165641
  • 26. JAVA 17 § com.sun.awt.SecurityWarning § java.security.acl.* § java.util.jar.Pack200* § jdk.net.SocketFlow* § java.rmi.activation* Removed Packages/Classes § java.management.rmi.RMIConnectorServer.CREDENTIAL_TYPES Removed Constants
  • 27. JAVA 17 § java.io.FileInputStream.finalize() § java.io.FileOutputStream.finalize() § java.lang.Runtime.traceInstructions(boolean) § java.lang.Runtime.traceMethodCalls(boolean) § java.util.zip.ZipFile.finalize() § java.util.zip.Inflater.finalize() § java.util.zip.Deflater.finalize() § netscape.javascript.JSObject.getWindow(Applet) § sun.misc.Unsafe.defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches) § javax.net.ssl.SSLSession.getPeerCertificateChain()** § java.lang.thread.countStackFrames()** Removed Methods § javax.tools.ToolProvider() § java.lang.invoke.ConstantBootstraps() § java.lang.relect.Modifier() Removed Constructors **APIs now throw UnsupportedOperationException - javax.net.ssl.SSLSession.getPeerCerficateChain(); + javax.net.ssl.SSLSession.getPeerCerficates();
  • 28. Top Migration Issues Missing Libraries Removed APIs Modularity & Strong Encapsulation Out-of-date Dependencies
  • 29. § Breaks code into modules containing packages § Applications must declare dependency on modules for access § Disruptive for Java SE application migrations Java Platform Module System (JPMS) § Use JDeps or --illegal-access=warn|debug Use find issues in your application § Use --illegal-access=permit If migrating to Java 11 § --add-opens launcher option § Add-Opens jar Manifest Attribute If migrating to Java 17+ MODULARITY
  • 30. Top Migration Issues Missing Libraries Removed APIs Modularity & Strong Encapsulation Out-of-date Dependencies
  • 31. OUT-OF-DATE DEPENDENCIES Libraries (ASM, Mockito, Spring, Spring Boot, etc) Build Tools (Maven, Gradle, etc) IDE (Eclipse, IntelliJ, VS Code, etc) Application servers (Open Liberty, JBoss, WebLogic, etc) My advice: take this time to upgrade your dependencies to the latest supported version. Setup automation tools.
  • 32. MAKING THE MOVE TO JAVA 17 WHAT ABOUT DEPRECATIONS?
  • 33. KEEP AN EYE ON DEPRECATIONS § Java RMI Activation § Thread.destroy() and Thread.stop(Throwable t) Some recently removed deprecations include: § Java Security Manager § Primitive wrapper class constructors Some APIs currently deprecated for removal: Full list: https://docs.oracle.com/en/java/javase/17/docs/api/deprecated-list.html#for-removal
  • 34. MAKING THE MOVE TO JAVA 17 WHAT TOOLS CAN I USE TO MAKE MY MIGRATION EASIER?
  • 35. USE CONTAINERS TO STAY UP TO DATE ¡ Use containers to easily keep your Java versions up to date ¡ This can be used to ensure you stay up to date with the latest fix packs, as well as test out new Java versions
  • 36. Application Binary Scanner Tool § Download: ibm.biz/WAMT4AppBi naries or Maven § Command line tool (free personal and commercial use) § Scans an application binary for migration issues and produces a report with identified problems, solutions and resource links § Documentation JDeps § Command utility shipped with JDK (run with the target Java version – Java 11+) § Migration Relevant Option: -jdkinternals § Binary scanner will recommend running JDeps if it identifies internal APIs § Documentation Tools to automate dependency updates (various options) § Use an auto-upgrade dependency tool to keep your dependencies up-to- date § Configure the tools to update based on various settings (frequency, etc) § Example: Dependabot Eclipse Transformer § Transform application binaries or source code to use the new package names in Jakarta EE 9+ § Documentation TOOLS
  • 37. DEMO
  • 38. NEXT STEPS Step 1 Evaluate your applications using the tools. Step 2 Try running your application on Java 17. If your app runs successfully, you can skip the next two steps. Step 3 Debug and fix your application code or build files. Repeat steps 1-3. Step 4 Update your dependencies and tools as needed. Step 5 Run all your application tests. Step 6 Celebrate!
  • 39. HELPFUL LINKS ¡ Our blog on adding the Java 17 feature to the migration tools (written instructions on running binary scanner): https://developer.ibm.com/tutorials/migration-to-java-11-made-easy/ ¡ Binary Scanner and Eclipse IDE Plugin Source Scanner downloads: ibm.biz/wamtdownloads § Documentation: https://www.ibm.com/docs/wamt ¡ Link to the java17demo GitHub repo: https://github.com/alexsm82/java17demo ¡ Oracle Java SE Support Roadmap: https://www.oracle.com/java/technologies/java-se-support- roadmap.html ¡ Java Version Almanac: https://javaalmanac.io/ ¡ Andy Guibert’s blog on OpenLiberty Java 11+ support: https://openliberty.io/blog/2019/02/06/java- 11.html ¡ Blog on running the binary scanner with Maven: https://community.ibm.com/community/user/wasdevops/blogs/alex- motley1/2022/04/12/applications-pipelines-and-migrations
  • 40. IBM SESSIONS ¡ Tuesday 10:00AM Fast JVM Startup with Checkpoint and Restore – Tobi Ajila | JVM Platform ¡ Tuesday 2:15PM Better, Stronger, Faster Java in the Cloud - Jarek Gawor and Tobi Ajila |Main Room (Java) ¡ 3:15 Book signing – Cloud Native Application Development with MicroProfile and Open Liberty and Birthday Cake ¡ Wednesday 10:00AM Making the Move to Java 17 – Alex Motley and Cindy High | Main Room (Java) ¡ Wednesday 1:15PM Relook at Microservices – Emily Jiang | Main Room (Java)