Life Beyond Java 8
New versions of Java are coming out every six months. What has changed, should we upgrade, and if so, how?
Join the DZone community and get the full member experience.
Join For FreeNew versions of Java are coming out every six months. What has changed, should we upgrade, and if so, how?
Abstract
Wasn’t Java 8 a fantastic update to the language? Lambdas and streams were a huge change and have helped to improve Java developers’ productivity and introduce some functional ideas to the language. Then came Java 9… and although the module system is really interesting for certain types of applications, the lack of exciting language features and uncertainty around how painful it might be to migrate to Java 9 left many applications taking a wait-and-see approach, happy with Java 8.
But now, Java has a new version every six months, and suddenly, Java 12 is here. But we’re all still on Java 8, wondering whether we should move to a later version, which one to choose, and how painful it might be to upgrade.
In this session, we’ll look at:
- Why upgrade from Java 8, including language features from Java 9, 10, 11, and 12
- What sorts of issues might we run into if we do choose to upgrade
- How the support and license changes that came in with Java 11 might impact us.
Resources
Updates, Licenses, and Support
- Java Champions: Java Is Still Free — this is a long and very detailed document explaining the changes in licenses and support
- Oracle: Oracle JDK Releases for Java 11 and Later — what are the changes to the license; why there are two Oracle JDK builds; is an OpenJDK build the same as an Oracle JDK build?
- JetBrains: Using Java 11 In Production: Important Things To Know
- Red Hat: The future of Java and OpenJDK updates without Oracle support — “…our policy of always “upstream first” implies that OpenJDK 8 will continue to be updated for critical bugs and security fixes until then. Something similar will happen for JDK 11.”
- Azul: Updated Choices For Java Updates — Azul’s summary of options
- IBM: Supporting the Java Community
Where to Get Your JDK From
- Time to look beyond Oracle’s JDK — here is a good explanation of the different JDKs provided and how they differ.
- AdoptOpenJDK
- Download prebuilt OpenJDK binaries — “AdoptOpenJDK provides prebuilt OpenJDK binaries from a fully open-source set of build scripts and infrastructure.”
- AdoptOpenJDK Support
- Amazon
- What is Amazon Corretto 8? — “Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK)”
- Download Corretto 8
- Azul
- IBM
- Oracle
- Red Hat
Migrating From Java 8
- My video course on Moving to Java 9 is available on Safari or can be purchased via InformIT. This has details about the features from Java 9 that are most interesting to Java developers, and a guide on how to migrate to Java 9.
- I wrote something for Oracle’s Java Magazine on Migrating from Java 8 to Java 9
- And, I wrote a related piece for InfoQ on Painlessly Migrating to Java Jigsaw Modules: a Case Study
- Java SE Oracle JDK 9 Migration Guide — Oracle’s guide
- All You Need To Know For Migrating To Java 11 — an in depth guide
- From Java 8 to Java 11 — some pointers
- Migrate Maven Projects to Java 11 — specific help for Maven. Includes some Java 9 Magic Incantations in the POM file that you might need.
- Migrating Spring Boot Applications to Java 11 — here is an interesting case study
- It’s time! Migrating to Java 11 — this is another case study
Features
Java 11
- Java 11 HTTP/2 API Tutorial
- Reactive HTTP/2 Requests and Responses in Java 11
- Scripting Java 11, Shebang, and All
- Eleven Hidden Gems In Java 11 — for me, it’s the tiny API changes that make my life as a developer easier
- Java 11 String API Additions
- Java’s new Z Garbage Collector (ZGC) is very exciting — “ZGC’s design targets a future where these kinds of capacities are common: multi-terabyte heaps with low (<10ms) pause times and impact on overall application performance (<15% on throughput).”
- Java 11 and IntelliJ IDEA
Java 10
- Java 10: Local-variable type inference
- Webinar: IntelliJ IDEA and Java 10 — this video and follow up blog post discusses the best places to use
var
Java 9
- Real World Java 9 — here is the presentation I was giving in 2017 about Java 9 features
- JEP 261: The Java Platform Module System
- Modules: Quick Start Tutorial
- Convenience Factory Methods for Collections
- jlink Reference Documentation
- Java 9 jlink Explained in 5 Minutes
- Java 9’s other new enhancements, Part 2: Milling Project Coin
- Reactive Programming with JDK 9 Flow API
- JEP 238: Multi-Release JAR Files
- Creating Multi-Release JAR Files in IntelliJ IDEA
- JEP 259: Stack-Walking API
- Deep Dive into the Stack-Walking API
- JEP 102: Process API
- JShell User’s Guide
- More methods on Optional
- Java 9 and IntelliJ IDEA
Java 12
- JDK 12 JEPs — this includes several related to Garbage Collection
- JEP 325: Switch expressions (Preview)
- Java 12 and IntelliJ IDEA — how IntelliJ IDEA can help you with the new switch expression syntax (available in IntelliJ IDEA 2019.1)
Java Future
- JEP 302: Lambda Leftovers (including underscore for param)
- JEP 305: Pattern Matching (Preview)
- Data Classes for Java and Brian Goetz on Data Classes for Java
- Project Amber — “The goal of Project Amber is to explore and incubate smaller, productivity-oriented Java language features”
- Valhalla — this includes Value Types
- Loom — Fibers, Continuations, and Tail-Calls for the JVM
Performance
- Java 11: JEP 331: Low-Overhead Heap Profiling
- How much faster is Java 11? — a case study that benchmarks both G1 GC and Parallel GC
Garbage Collectors
- Java 9: JEP 248: G1 the Default Garbage Collector
- Java 10: JEP 307: Parallel Full GC for G1
- Java 10: Improvements to Garbage Collection explained in 5 minutes
- Java 11: JEP 318: Epsilon: A No-Op Garbage Collector (Experimental)
- Java 11: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental), see also ZGC Wiki
- Java 12: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental), see also Shenandoah GC Wiki
- Java 12: More Updates to G1
String Performance
- Java 9: JEP 254: Compact Strings
- Compact Strings in Java 9
- Java 9: JEP 280: Indify String Concatenation
- Evolution of Strings in Java to Compact Strings and Indify String Concatenation
Other
Published at DZone with permission of Trisha Gee, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments