JetBrains Technology Day for Java – Life Beyond Java 8
On the 10th July 2020, JetBrains hosted a Technology Day for Java. We had 10 presentations and the videos for them are available here. Over the coming weeks, in no particular order, we’d like to share with you extra resources that our speakers kindly provided and any links to further reading or code samples.
We hosted Trisha Gee talking to us everything that’s happened since Java 8. Java 8 was a huge release for Java, finally bringing some much anticipated functional behaviours to the Java language. Java 9 followed up 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.
Now Oracle release Java every six months, and Java 15 is nearly here. However, there’s still a lot of people 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 Trisha helped us to understand:
- Which version of Java should we upgrade to
- Why we need to upgrade from Java 8, including a summary of language features from Java 9 through to 15
- What sorts of issues we might run into if we do choose to upgrade
Trisha strongly recommends that you upgrade to Java 11 (Oracle’s Long Term Service release) or Java 14 (almost Java 15) if you’re going to subsequently upgrade every 6 months and explains why in this video. Trisha also recommends that you can reduce future pain by testing against the 6-month releases using continuous integration.
Trisha demonstrated many of these features with live coding and she has pulled together a lot of useful information from the Java community to assist you. In this blog we’ve split them out into release sections.
- JShell Introduction
- Best places to use var
- Convenience Factory Methods for Collections
- Collecting to immutable collections from a Stream operation
- More methods on Optional
- Introduction to the Java Http client
- Creating Multi Release Jar Files
- Migrating to Jigsaw
- JLink Explained in 5 Minutes
- Switch Expressions
- Records (preview)
- Text Blocks (preview)
- Pattern Matching For InstanceOf() (preview)
Finally, as we write this, Java 15 is almost here. Of course, don’t use preview features in production code! Here’s a list of anticipated content for Java 15:
- Text Blocks
- Hidden Classes
- ZGC Garbage Collector
- Pattern Matching for instanceof (preview)
- Records (preview)
- Sealed Classes (preview)
In summary, here is a great list of reasons to upgrade from Java 8:
- Performance – newer versions of Java have a lower latency and include things like better Docker support.
- Use of memory – things like compact strings and more make Java more efficient.
- Garbage collection changes – there are plenty to choose from here.
- Cost – it will become increasingly expensive to hire developers to work on Java 8 because we want to work on newer versions on Java.
When you start your migration, here are some tips for things to do and in what order and a blog from Trisha on the subject:
- Run on an updated JDK, it might just work!
- Address the compiler warnings, don’t ignore them, stuff will eventually get removed after a period of deprecation.
- Update your dependencies for security reasons and add those that you need with your new JDK.
- Update your build tools such as Maven and Graven.
- Lastly, compile it on an updated JDK (don’t do this first)!
Trisha’s Presentation and More Resources
JetBrains blogs for each Java Release
Links to the Future of Java
What our audience thought of Trisha’s presentation
— Sara (@SaraTorrey) July 10, 2020
I was just thinking: who’s the next speaker? I hope they turn up on time! And… it’s me!! I’m already here. We’ve seen new feature in Java mentioned by both of the previous speakers, in my talk I’ll show a bunch more and talk about why we want to upgrade #JBTechDayforJava https://t.co/iZI1uqsHkV
— Trisha Gee (@trisha_gee) July 10, 2020
I started learning @java five years ago. Java’s been here for five times that long. @trisha_gee‘s talk on “Life beyond Java 8” just proves to me that Java is not really an old language, it’s imbibing so many good features from so many good languages around. #JBTechDayforJava
— Mourjo Sen (@mourjo_sen) July 10, 2020