You can tell that Java 9 draws near because the number of posts and talks about it skyrocketed in the recent months. I want to recommend existing talks and articles where you can learn about Java 9 but also further resources, where new, high-quality content will pop up.
If you’re the kind of person who likes to watch talks, there are quite a few I can recommend. For a great high-level overview and conceptual intro to the module system, watch Java 9: Make Way for Modules! (Mark Reinhold; 40 min). Going deeper into the module system, the JDK team has an entire series of talks:
- Introduction to Modular Development (Alan Bateman; 55 min)
- Advanced Modular Development (Mark Reinhold, Alan Bateman; 60 min)
- Project Jigsaw: Under The Hood (Mark Reinhold; 60 min)
As a follow-up, there was an Ask the Architect session at JFokus where Mark Reinhold answers all kinds of questions, among them some about Java 9 (transitive dependencies, version conflicts, state of JavaFX, ahead-of-time compilation; 23 min).
With Java 9 coming closer, people started presenting on non-modularity features that Java 9 has to offer. Simon Ritter races through 55 new features in JDK 9 (50 min) and this is me talking a little bit about the module system before going into the new language features, a few new APIs (collection factories, reactive streams aka Flow API, stack-walking, multi-release JARs) and performance (50 min). If you want to dive deeper, there is a talk by Aleksey Shipilëv on compact strings and indified string concatenation, which I highly recommend (60 min). Monica Beckwith explains about G1 but be warned, you better have your GC expertise down before giving this a try (55 min).
There are also a number of great talks that are much more practical. To learn about how Maven deals with with Java 9, watch Robert Scholte talk about Unicode encoding, version strings, cross compilation, multi-release JARS, and then of course Jigsaw with its impact on how Maven works but also what it has to offer (50 min). Don’t miss live-coding queen Trisha Gee working on a Java 9 project with IntelliJ, where she demonstrates various features of both the JVM and the IDE (30 min). If you’re interested to see what a migration to Java 9 modules might look like, watch Rabea Gransberger live-refactor a small demo project (15 min). Of course there is no way to talk about live-coding without mentioning Venkat Subramaniam, who shows off modules and JShell in a mammoth 150 minute live session.
For shorter bits there are a couple of interviews the Voxxed folks recorded:
- Mark Reinhold talks about strong encapsulation, open modules, compatibility, and sun.misc.Unsafe (10 min).
- Venkat Subramaniam talks about compatibility, the Flow API, and wishes for future Java versions (13 min).
- I talk about migration and command line escapes (not yet the new --permit-illegal-access, though) (7 min)
Of course people started writing code and there are a few interesting repositories that demonstrate Java 9 features:
- CodeFX/java-9: A repository demonstrating all kinds of Java 9 features
- AdoptOpenJDK/jdk9-jigsaw: Examples of some of the module system features
- CodeFX/jigsaw-advent-calendar: A simple demo application demonstrating JPMS features
- CodeFX/jpms-monitor: The JPMS demo application I use in my book
There are countless articles about Java 9, so there is simply no way to do everyone justice. Here’s my try of listing the more important ones:
- Additions To Stream API, New Stream Collectors
- Process API: The Shape of Things to Come
- Java Time (JSR-310) enhancements
- Concurrency Updates
- Additions To Optional
- Deep Dive into Stack-Walking API
- Convenience Factory Methods for Collections
- Applying @Deprecated Enhancements
- Using sun.misc.Unsafe
- Variable Handles
- Reflection vs Encapsulation – Stand Off in the Java Module System
- Generating Multi-Release JARs with Maven, Building Multi-Release JARs with Maven
- Adjust Memory Limits if Running with Docker
- JShell – Getting Started and Examples
For a longer list of posts, check out Baeldung’s Java 9 site.
I want to end whit list with a teaser: One particular interesting part about Java 9 modularity is whether build tools will generate module declarations. Next Monday Robert Scholte, chairman of the Apache Maven project and principal developer of Maven’s Java 9 compatibility and features, will tell us whether Maven can do that for you. Spoiler: It doesn’t look good.
There are a few blogs and sites that regularly publish about Java 9. Most of them have the decency to tag those posts, so you don’t have to go searching. Company blogs/sites:
- Baeldung (Eugen Baeldung)
- Iteratr Learning (no Java 9 tag; Raoul-Gabriel Urma and Richard Warbuton)
- CodeFX (mine)
- Joda (Stephen Colebourne)
Books and Courses
If you want to go really deep and prepare yourself for actually using the new stuff, you might want to go for a book or online course. These are the ones I know of:
- Java 9 Modularity: First Look (Sander Mak with Pluralsight)
- Java 9 Modularity (Sander Mak and Paul Bakker with O’Reilly)
- Java 9 Modularity – Project Jigsaw and Scalable Java Applications (Alexandru Jecan with Apress)
- Mastering Java 9 (Martin Toshev with Packt)
- Modular Programming in Java 9 (Koushik Kothagal with Packt)
- Java 9 with JShell (Gastón C. Hillar with Packt)
- Java 9 Module System (me with Manning)
And because this is my blog I will take the freedom to make sure you don’t overlook that the last book on that list is by me, which of course makes it the best one. 😜 Early access is open, so you can get it now!