The feature we always hear about whenever Java 9 is in the news is Jigsaw, modularity. But this doesn't scratch the same developer itch that Java 8's lambdas and streams did, and we're left with a vague sensation that the next version might not be that interesting.
Java 9 actually has a lot of great additions and changes to make development a bit nicer. These features can't be lumped under an umbrella term like Java 8's lambdas and streams, the changes are scattered throughout the APIs and language features that we regularly use.
In this presentation Trisha will show, via live coding:
- What the Java Platform Module System is and how to make your code modular
- How we can use the new Flow API to utilise Reactive Programming
- The improvements to the Streams API that make it easier to control infinite streams
- How to the Collections convenience methods simplify code
Along the way we'll bump into other Java 9 features, including some of the additions to interfaces and changes to deprecation.
17. • JEP 200: The Modular JDK
• JEP 201: Modular Source Code
• JEP 220: Modular Run-Time Images
• JEP 260: Encapsulate Most Internal APIs
• JEP 261: Module System
• JEP 282: jlink: The Java Linker
• JSR 376: Java Platform Module System
Project Jigsaw
Firstly, show IntelliJ working perfectly fine with JDK 9
Show “sense” at the Java 8 level compiling with Java 9
Will have some missing pieces
Can’t use underscores
THIS SECTION IS ABOUT ERRORS THAT MIGHT NOW BE IN YOUR CODE
Lets the JDK developers move faster, so we can deliver twice a year
Incubating
Started with Gradle Structure
Ended up with this
Started with Gradle Structure
Ended up with this
JDK 9
Support in the IDE:
- doesn’t error
- can create module-info files
- basic code completion:
* requires, plus completion for jdk modules
* exports, plus completion for module names
* opens… to… and completion
- suggests adding “requires” lines
- manually have to add exports
- module diagrams
20 minutes into presentation?
Need at least 15 minutes remaining
This section is 10 minutes
Oxymoron
Annotation params
No warning on imports
Wish the param had been called “doomed”
Can generate inside IntelliJ with…
-html5
Including camel case search
http://download.java.net/java/jdk9/docs/api/overview-summary.html
https://youtrack.jetbrains.com/issue/IDEA-161611
Please do give us feedback
5 minutes remaining?
Defaults (GC) changing, validation being added, tools removed, internal APIs being hidden, logging messages changing
Gradle, Groovy not working for me
You can make use of the modules in the JDK, but you don’t need to apply it everywhere