11. Sneak peek
• Java Shell (JShell)
• New process API
• Small language enhancements
• G1 as the default garbage collector
12. Sneak peek
• New HTTP/2 client
• New stack walking API
• New reactive programming API
• Misc
13. Java Shell (JShell)
• Provides a read-eval-print-loop (REPL) shell for the
Java platform
• Provides a playground for the Java language and its
supporting APIs
• Provided by the jshell tool part of the JDK installation
14. New process API
• Before Java 9 ….
Process p = Runtime.getRuntime().exec("cmd /c notepad");
ProcessBuilder pb = new ProcessBuilder("cmd", "/c", “notepad");
Process p = pb.start();
15. New process API
• Limited support for process handling up to JDK 9
• Mostly for creation of a process …
16. New process API
• java.lang.Process extended with new methods
• New Java.lang.ProcessHandle class for process
management in a streamlike manner
onExit()
supportsNormalTermination()
toHandle()
children()
descendants()
pid()
info()
17. Small language enhancements
• Not really many … (var definitions did not make it
in Java 9)
• A few very minor enhancements part of project
Coin (the most significant being private methods
in interfaces)
18. G1 GC
• Replaces parallel GC as the default GC
• A low-pause collector
• Sacrifyes higher throughput
(… targets to provide better experience for users)
19. G1 GC
• The unit of work is a heap region in a generation
• Provides new framework for further optimizations
• Most other GCs work on generations directly
20. G1 GC
• Targets to clear as much garbage as possible
• Has larger footprint than parallel GC
21. HTTP/2 client
• Still in incubation (although part of release)
• Provides support for HTTP 2.0
22. Stack walking API
• new API for easier manipulation of stack traces
• Provided by the java.lang.Stackwalker class
23. Reactive programming API
• New publish-subscribe API
• Provided by the java.util.concurrent.Flow interface
28. Summary
• The new module system is beyond doubt the
most significant feature of JDK 9
• There are many new APIs in JDK 9 that extend
the developer’s toolbox
29. References
New features in Java 9
https://docs.oracle.com/javase/9/whatsnew/
Project Jigsaw
http://openjdk.java.net/projects/jigsaw/
Oracle JDK 9 Documentation Early Access
https://docs.oracle.com/javase/9/javase-docs.htm