$30 off During Our Annual Pro Sale. View Details »

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. 9 Lives of Java 9
    @LAFK_pl Consultant @
    NO
    WORKSHOPS

    View Slide

  2. About me
    @LAFK_pl
    Consultant @
    Tomasz Borek

    View Slide

  3. 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

    View Slide

  4. 1st Life
    @LAFK_pl Consultant @

    View Slide

  5. Oak – The Green Platform

    View Slide

  6. The Green Team

    View Slide

  7. Green project

    C++ extension →

    Oak →

    Green Platform (OS)→

    Java

    Home entertainment

    View Slide

  8. Green project

    View Slide

  9. Star 7 home entertainment system

    Star 7 (summer 1992)

    View Slide

  10. The Duke Mascott

    Star 7 (summer 1992)

    View Slide

  11. 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...

    View Slide

  12. 2nd Life
    @LAFK_pl Consultant @
    January 23, 1996

    View Slide

  13. Java – JDK 1.02

    View Slide

  14. WORA

    JIT (Just In Time) compiler for Windows

    Network byte order

    So, all that to run C code?

    View Slide

  15. 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

    View Slide

  16. 3rd Life
    @LAFK_pl
    December 8, 1998 Consultant @

    View Slide

  17. Playground

    View Slide

  18. Playground

    Tripled in size

    Introduced JCF

    strictfp keyword

    Swing graphical API

    Sun’s JVM had a JIT
    compiler now

    Java plug-in

    View Slide

  19. View Slide

  20. Enterprise

    Lovely Sun marketing
    – SE, ME, EE

    Enterprise rulz
    – J2EE :-)

    EJBOSS

    Desktop? Forget it!

    View Slide

  21. 4th Life? Nah, just growth
    @LAFK_pl
    May 8, 2000 Consultant @

    View Slide

  22. 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.

    View Slide

  23. First community edition

    As JSR-59

    Java Community
    Process

    February 6th, 2002

    View Slide

  24. 4th Life
    @LAFK_pl
    September 30, 2004 Consultant @

    View Slide

  25. Tiger

    Majority of interview
    questions
    – Next big thing is JDK8

    Enum, annotations,
    generics, foreach,
    varargs, auto-/un-
    boxing, concurrency,
    scanner...

    Improved JMCM!

    View Slide

  26. Un-Life
    @LAFK_pl
    Till, 2012 or so Consultant @

    View Slide

  27. 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/

    View Slide

  28. Ends because...

    Too much chaos in marketing

    Too much problems with enterprise

    View Slide

  29. RIP
    October 08, 2013:
    if Java is dying, it sure looks awfully healthy

    View Slide

  30. Game changers

    View Slide

  31. Current Life (5th)
    @LAFK_pl
    March 18, 2014 Consultant @
    JDK 8 March 18, 2014
    JDK 9 September 21, 2017

    View Slide

  32. So, JDK 9 JEPS?
    91 all together
    GA on 21st September 2017
    lafk.pl/jdk9-on-jdd/

    View Slide

  33. 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

    View Slide

  34. 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

    View Slide

  35. Project Kulla = JShell

    Build web-app with REPL with Kuba Marchwicki

    View Slide

  36. 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!

    View Slide

  37. Project Jigsaw

    Rabea Gransberger – refactor to modules

    View Slide

  38. 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

    View Slide

  39. 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

    View Slide

  40. 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

    View Slide

  41. 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

    View Slide

  42. JEP 266: More concurrent updates

    View Slide

  43. 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

    View Slide

  44. 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

    View Slide

  45. 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

    View Slide

  46. 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

    View Slide

  47. 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?

    View Slide

  48. Future (JDK18.03?) changes?

    View Slide

  49. 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

    View Slide

  50. 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

    View Slide

  51. 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!

    View Slide

  52. 9 Lives of Java 9
    @LAFK_pl
    Now it will move faster!
    4 remain!
    Consultant @

    View Slide