SlideShare a Scribd company logo
—
Trisha Gee (@trisha_gee)
Developer & Technical Advocate, JetBrains
Real World Java
9
Any questions?
Use the Questions pane in the GoToWebinar window. We’ll try to answer as we go along.
Real World Java 9 - JetBrains Webinar
Real World Java 9
• Jigsaw in Action
• The Reactive API in Java 9
• Everything Else
Why Java 9?
Free Lunch!
• Better Use of Memory
• Better Performance of:
• Locking
• Secure Apps
• Graphics
• Better Use of Hardware
• Better Documentation
• Prettier Graphics (Windows and Linux)
• Faster Compilation
Jigsaw
REPL
And… other things?
274: Enhanced Method Handles
275: Modular Java Application Packaging
276: Dynamic Linking of Language-Defined Object Models
277: Enhanced Deprecation
278: Additional Tests for Humongous Objects in G1
279: Improve Test-Failure Troubleshooting
280: Indify String Concatenation
281: HotSpot C++ Unit-Test Framework
282: jlink: The Java Linker
283: Enable GTK 3 on Linux
284: New HotSpot Build System
285: Spin-Wait Hints
287: SHA-3 Hash Algorithms
288: Disable SHA-1 Certificates
289: Deprecate the Applet API
290: Filter Incoming Serialization Data
292: Implement Selected ECMAScript 6 Features in Nashorn
294: Linux/s390x Port
295: Ahead-of-Time Compilation
297: Unified arm32/arm64 Port
298: Remove Demos and Samples
The Case Study
Twitter Dashboard
Real World Java 9 - JetBrains Webinar
http://bit.ly/Java8InAnger
Compiling with Java 9
Jigsaw
• 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
Java Platform Module System
(JPMS)
Real World Java 9 - JetBrains Webinar
Real World Java 9 - JetBrains Webinar
Real World Java 9 - JetBrains Webinar
Real World Java 9 - JetBrains Webinar
module-info.java
Pain
• Some structural reorganisation may be needed
• IDE support is not what we’re used to
• RTFM. No, really do.
• Cleaner design
• Reliable configuration
• Smaller deployables
Gain
Reactive API
Reactive Streams API
• Akka Streams
• MongoDB Reactive Java Driver
• Ratpack
• Reactive Rabbit
• Reactor
• RxJava
• Vert.x
Implementations
Java 9 Flow API
Real World Java 9 - JetBrains Webinar
Other Java 9 Features
269: Convenience Factory Methods
for Collections
213: Private Methods on Interfaces
New Methods on the Streams API
New Methods on Optional
259: Stack-Walking API
102: Process API Updates
238: Multi-Release JAR Files
277: Updated Deprecation
224: HTML5 Javadoc
225: Javadoc search
Real World Java 9 - JetBrains Webinar
JShell (REPL)
https://docs.oracle.com/javase/9/jshell/int
roduction-jshell.htm
We’d Love Your Help
https://youtrack.jetbrains.com/issue/IDEA-
161611
The Pain
Your code might break!
Try it out now to find out sooner, not later
• 214: Remove Deprecated GC Combinations
• 231: Remove Launch-Time JRE Version Selection
• 240: Remove the JVM TI hprof Agent
• 241: Remove the jhat Tool
• 260: Encapsulate Most Internal APIs
• 289: Deprecate the Applet API
• 298: Remove Demos and Samples
Going Away
• 158: Unified JVM Logging
• 223: New Version-String Scheme
• 245: Validate JVM Command-Line Flag Arguments
• 248: Make G1 the Default Garbage Collector
• 271: Unified GC Logging
Possible Unexpected Behaviour
Tools are still evolving
…another reason to try it early
Don’t rush in to modularisation
It might not be for you
The Gain
Encourages good design
Encourages new ways of working
Just a bit nicer to write code
…and you’ll be ready for Java 10
Or 18.3…
http://bit.ly/RealJava9

More Related Content

Real World Java 9 - JetBrains Webinar

Editor's Notes

  1. Show the working application
  2. 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
  3. Lets the JDK developers move faster, so we can deliver twice a year Incubating
  4. Started with Gradle Structure Ended up with this
  5. Started with Gradle Structure Ended up with this
  6. JDK 9
  7. 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
  8. 20 minutes into presentation?
  9. Need at least 15 minutes remaining This section is 10 minutes
  10. Oxymoron Annotation params No warning on imports Wish the param had been called “doomed”
  11. Can generate inside IntelliJ with… -html5
  12. Including camel case search http://download.java.net/java/jdk9/docs/api/overview-summary.html
  13. https://youtrack.jetbrains.com/issue/IDEA-161611 Please do give us feedback
  14. 5 minutes remaining?
  15. Defaults (GC) changing, validation being added, tools removed, internal APIs being hidden, logging messages changing
  16. Gradle, Groovy not working for me
  17. You can make use of the modules in the JDK, but you don’t need to apply it everywhere
  18. Modules, separation of concerns
  19. REPL, Reactive
  20. All the other features