JDK 17 is here. Shall i upgrade ? Why and How ..
Oracle has announced its GA of JDK 17 on 14th Sep, with following changes
What’s been added ?
- JEP_306 Restore Always-Strict Floating-Point Semantics
- JEP_356 Enhanced Pseudo-Random Number Generators
- JEP_382 New macOS Rendering Pipeline
- JEP_391 macOS/AArch64 Port
- JEP_406 Pattern Matching for switch (Preview)
- JEP_409 Sealed Classes
- JEP_412 Foreign Function & Memory API (Incubator)
- JEP_414 Vector API (Second Incubator)
- JEP_415 Context-Specific Deserialization Filters
What’s has been removed ?
- JEP_403 Strongly Encapsulate JDK Internals
- JEP_407 Remove RMI Activation
What’s been deprecated ?
- JEP_277 Enhanced Deprecation
- JEP_398 Deprecate the Applet API for Removal.
- JEP_411 Deprecate the Security Manager for Removal
- Deprecate 3DES and RC4 in Kerberos
- Deprecate the Socket Implementation Factory Mechanism
- Deprecate JVM TI Heap functions 1.0
Why to upgrade ?
Yes it requires time an effort to migrate from current version of Java 8,9,14 etc to Java 17 , Then what factors makes me decide on shall o migrate or not ?
What should I look for in new release ?
- Performance Benefits
- Security Fixes
- Cool new features (like Pattern matching in latest release)
- Or something which makes your code robust and better maintainable
- What’s being deleted and deprecated
Things to consider before upgrade
- Nature of your application
- Under which environment you are building and deploying your application
- How many dependencies your application has
How to upgrade ?:
- Simplest approach would be start with local JDK and make sure you fix all the issues
- OR — If you are using Docker Image or Kubernetes based CI/CD setup you might put latest java version as part of image
- OR — An alternate option to make use of maven tool chain where you change Java version to support multiple JDK
- Proceed to upgrading used dependencies, Some time you got to wait or look for alternate options if framework you are using has not yet compatible with latest java version.
- Fix code for deprecated and removed API’s
How much time it will take to upgrade to Java 17 ?
- It might take from few days to couple of weeks depending on to factors listed above.
What’s the history and future of Java Releases ?
Sample Code : I will be adding some sample code in the next section of article ,till then let me know what you think about Java 17 and how is your upgrade experience with it .