Upgrade to Pro — share decks privately, control downloads, hide ads and more …

9 Lives of Java 9 abridged

9 Lives of Java 9 abridged

Not a focused presentation, but rather an overview of all features with highlights on shell, modules, and G1GC. An abridged version of 9 Lives of Java 9, allowing for some time for a practical demo or trivia game.

First presented at @JDD_Krakow on 3rd October 2017.

Tomasz Borek

October 03, 2017
Tweet

More Decks by Tomasz Borek

Other Decks in Programming

Transcript

  1. Currently • Kraków • Newbies or juniors • 4-5 months

    • To programmers • Or as close as I can • µservices etc. • With JS, QA, etc. • 4th edition starts this November
  2. Green project • C++ extension → • Oak → •

    Green Platform (OS)→ • Java • Home entertainment
  3. Ends because... • Too much control in hands of the

    users – Cable TV industry wants dumber remotes • PDAs didn’t quite took off • Instead, World Wide Web did – Hence, WebRunner → HotJava, browser – Appropriate interactivity – 1994 – retargeting to WWW – 1995 – HotJava – 1996...
  4. WORA • JIT (Just In Time) compiler for Windows •

    Network byte order • So, all that to run C code?
  5. JDK 1.02, first Java • AWT event model • Inner

    classes • JavaBeans • JDBC • RMI • Reflection (introspection only, TBH) • GC • VM • MCM (green threads) • Sandbox February 19, 1997
  6. Playground • Tripled in size • Introduced JCF • strictfp

    keyword • Swing graphical API • Sun’s JVM had a JIT compiler now • Java plug-in
  7. Enterprise • Lovely Sun marketing – SE, ME, EE •

    Enterprise rulz – J2EE :-) • EJBOSS • Desktop? Forget it!
  8. Spreading the wings • Kestrel (1.3, right) – improvements everywhere

    (PermGen, HotSpot JVM). JNDI and JPDA though! • Merlin had APIs and libs: NIO, JAXP, Logging, JDBC 3, Preferences, Ipv6, RegEx, Images. Plus Java Web Start, assert and chaining exceptions.
  9. Tiger • Majority of interview questions – Next big thing

    is JDK8 • Enum, annotations, generics, foreach, varargs, auto-/un- boxing, concurrency, scanner... • Improved JMCM!
  10. Mustang and Dolphin • Invokedynamic • 64bit pointers • Coin

    • 8 and 9 • perf • JVM perf • GUI (Swing) • javac, JDBC 4, JAXB 2 http://openjdk.java.net/projects/coin/
  11. Current Life (5th) @LAFK_pl March 18, 2014 Consultant @ JDK

    8 March 18, 2014 JDK 9 September 21, 2017
  12. So, JDK 9 JEPS? 91 all together GA on 21st

    September 2017 lafk.pl/jdk9-on-jdd/
  13. Project Kulla = JShell • 222: jshell – the Java

    shell (REPL) • Kulla – builder god, banished when done • https://docs.oracle.com/javase/9/tools/jshell.htm • /command → /exit /help intro /help shortcuts • /list • /save • /open some-java-file.java
  14. Project Kulla = JShell • 222: jshell – the Java

    shell (REPL) • Features Tab-completion, quite nice at that! • Jline uses C readline lib • Look for ~/.inputrc or /etc/input.rc
  15. Project Jigsaw • JAR hell, classpath loading problems • JARs

    are not components, they are files • JDK and most Java apps are monoliths • JDK weighs a lot • Your Java app weighs a lot • µservices aren’t monolithic (shouldn’t be!) • Game changers!
  16. Project Jigsaw - JEPs • 162: Prepare for Modularisation •

    200: The Modular JDK • 201: Modular Source Code (Jigsaw itself) • 220: Modular Run-Time images – Standard class libraries modularised (rt.jar) – Files more efficient than JAR • 260: Most internal APIs now encapsulated – Unsafe, VarHandles, MethodHandles • 275: java packager • 282: jlink, Java linker 7 in total
  17. Modules in a nutshell • Base always present • Requires

    – modules you need • Exports – what you publish (here public matters) • Use – required services – via ServiceLoader • http://cr.openjdk.java.net/~mr/jigsaw/jdk9-module-summary.html • https://bugs.openjdk.java.net/secure/attachment/72525/jdk.png • module-info.java, module path • jlink, jdepend • https://github.com/accso/java9-jigsaw-depvis
  18. Default GC is G1 • JEP 248 • CMS deprecated

    – ParNew as well • Regions, categorized • Huge objects • JEPs: – 250: Strings in CDSes – 214: remove deprecated combinations • Not for small heaps • String Deduplication – JEP 192, 8u20
  19. Unicode, Javadoc, Nashorn • 221: Simplified Doclet API • 224:

    HTML5 Javadoc • 225: Javadoc Search • 226: UTF-8 Property Files • 267: Unicode 8.0 (7,3k+) • 227: Unicode 7.0 (2,8k+) • 236: Parser API for Nashorn • 252: Use CLDR Locale Data by Default • 292: Implement Selected ECMAScript 6 Features in Nashorn 9 in total
  20. Things will be removed! • 277: Enhanced Deprecation • 289:

    Deprecate the Applet API – forRemoval set to false • 214: Remove GC Combinations Deprecated in JDK 8 • 231: Remove Launch-Time JRE Version Selection • 240: Remove the JVM TI hprof Agent • 241: Remove the jhat Tool • 298: Remove Demos and Samples 5 in total
  21. Security • 219: Datagram Transport Layer Security (DTLS) • 229:

    Create PKCS12 Keystores by Default • 244: TLS Application-Layer Protocol Negotiation Extension • 249: OCSP Stapling for TLS • 273: DRBG-Based SecureRandom Implementations • 287: SHA-3 Hash Algorithms • 288: Disable SHA-1 Certificates • 290: Filter Incoming Serialization Data 8 in total Another 8 in perf
  22. Libraries changes • 255: Merge Selected Xerces 2.11.0 Updates into

    JAXP • 259: Stack-Walking API • 260: Encapsulate Most Internal APIs • 266: More Concurrent Updates • 269: Convenience Factory Methods for Collections 5 selected
  23. JVM changes • 193: Variable Handles • 245: Validate JVM

    Command-Line Flag Arguments • 228: Add More Diagnostic Commands • 238: Multi-Release JAR Files • 247: Compile for Older Platform Versions • 223: New Version-String Scheme • 217: Annotations Pipeline 2.0 • 280: Indify String Concatenation • 272: Platform-Specific Desktop Features Whopping 32 in total • 233: Generate Run-Time Compiler Tests Automatically • 235: Test Class-File Attributes Generated by javac • 211: Elide Deprecation Warnings on Import Statements • 212: Resolve Lint and Doclint Warnings • 216: Process Import Statements Correctly • 279: Improve Test-Failure Troubleshooting • 281: HotSpot C++ Unit-Test Framework • 284: New HotSpot Build System • 248: Make G1 the Default Garbage Collector • 278: Additional Tests for Humongous Objects in G1 • 243: Java-Level JVM Compiler Interface • 270: Reserved Stack Areas for Critical Sections • 274: Enhanced Method Handles • 237: Linux/AArch64 Port • 158: Unified JVM Logging • 271: Unified GC Logging • 165: Compiler Control
  24. So...? • Jigsaw and modularity – Image, modules, JAR replace,

    linking, deps finding • JVM – tooling, ground work (CLI, GC, String indify), • APIs – JShell, Stack Walking, Process, Flow • Performance, Security • Why?
  25. Java 18.03 • Every quarter (first month): bug fixes and

    patches • Every March – feature release • Every September – LTS feature release – LTS – 3 years • https://mreinhold.org/blog/forward-faster
  26. In short • Java went like a river, changing directions

    – Smart appliances → net → EE → SE → FP – Devs see language changes, but there’s more • IoT, Big Data, Cloud (hence: FP, modularity) • Jigsaw is the theme, but foundations improved! – JDK, perf, Strings, compiler, GC, tooling – Stack, Process, Jshell, Xerces, Flow
  27. Java EE – Not J2EE, not anymore • Waited for

    JDK9 and Jigsaw • Folks moved ahead though – EE Guardians (https://javaee-guardians.io/) – MicroProfile (http://microprofile.io/) – Spring and container/server vendors • Good summary – https://www.infoq.com/news/2017/04/long-road-for-java-ee-8 • Donated to Eclipse Foundation!
  28. 9 Lives of Java 9 @LAFK_pl Now it will move

    faster! 4 remain! Consultant @