
JDK 9 Language, Tooling, and Library Features More than modules! #JDK9LangToolsLibs Joseph D. Darcy (@jddarcy) Java Platform Group Oracle September 19, 2016 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 2 . Pictures copyright 2012 Joseph D. Darcy All rights reserved All rights Darcy 2012 JosephD. copyright Pictures Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 3 Survey: Which JDK train are you using in production? • JDK 9 EA with cutting edge Jigsaw • JDK 9 EA • JDK 8 • JDK 7 • JDK 6 • JDK 5.0 or older Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 4 JDK 9 Overview Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 5 JDK 9 Information • Current proposed schedule: GA July 2017, weekly updates: • Early access binaries + docs: https://jdk9.java.net/ • Early access binaries with cutting edge Jigsaw: https://jdk9.java.net/jigsaw/ • OpenJDK : • Project: http://openjdk.java.net/projects/jdk9/ • Mailing list: http://mail.openjdk.java.net/mailman/listinfo/jdk9-dev • Source code: http://hg.openjdk.java.net/jdk9/dev/ • Adoption: http://mail.openjdk.java.net/pipermail/adoption-discuss/ https://wiki.openjdk.java.net/display/quality/Quality+Outreach/ • JEPs (JDK Enhancement Proposals) used for project tracking Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 6 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 7 Capsule summary of modularity impact in JDK 9 • Modules bundle together one or more packages and can offer stronger encapsulation than jars • Supporting changes throughout the platform: • module-info.java files to declare dependencies between modules • Changes to javac command line to find types in modules as well as in jars • Corresponding updates to java command line and runtime • New reflective APIs to model modules (core reflection, javax.lang.model, etc.) Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 8 Jigsaw Team JavaOne 2016 Modularity Sessions & Tutorial • Prepare for JDK 9 [CON2937] • Project Jigsaw: Under the Hood Monday, Sep 19, 12:30 pm – 1:30 pm [CON2963], Tuesday, Sep 20, 2:30 pm – 3:30 pm Tuesday, Sep 20, 4:00 pm – 5:00 pm • Introduction to Modular Development • Modules and Services [CON2949], [CON3707], Tuesday, Sep 20, 11:00 am – 12:00 pm Monday, Sep 19, 2:30 pm – 3:30 pm Thursday, Sep 22, 2:30 pm – 3:30 pm Wednesday, Sep 21, 3:00 pm – 4:00 pm • Project Jigsaw Hack Session [TUT4210], • Advanced Modular Development Wednesday, Sep 21, 8:30 am – 10:30 am [CON3711], Monday, Sep 19, 5:30 pm – 6:30 pm Wednesday, Sep 21, 4:30 pm – 5:30 pm Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 9 Outline • Stewardship and platform evolution • Tooling improvements • Language changes • Library updates • Q & A Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 10 Outline • Stewardship and platform evolution • Tooling improvements • Language changes Cumulative Bugs fixes by build in JDK 8 and 9 18000 JDK 8 cumulative JDK 9 • Library updates 16000 JDK 9 cumulative b134 14000 • Q & A Difference (9-8) 12000 JDK 8 10000 GA 8000 6000 4000 2000 0 0 20 40 60 80 100 120 140 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 10 Outline • Stewardship and platform evolution • Tooling improvements • Language changes Many feature cross these boundaries • Library updates • Q & A Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 10 Stewardship Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 11 Background: JDK General Evolution Policy From the OpenJDK Developers’ Guide “The general evolution policy for Java SE APIs implemented in OpenJDK is: 1. Don’t break binary compatibility (as defined in the Java Language Specification). 2. Avoid introducing source incompatibilities. 3. Manage behavioral compatibility changes.” • Extends to language evolution too • Continue to recognize old class files • Limit cases where currently legal code stops compiling • Avoid changes in code generation introducing behavioral change Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 12 Release Compatibility Regions Binary Behavioral Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 13 Release Compatibility Regions Binary Note: Figure not drawn to scale. Behavioral Security Update Releases (CPU), 8u75, 8u81, 8u85, … Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 13 Release Compatibility Regions Feature Update Releases (PSU), 8u20, 8u40, … Binary Note: Figure not drawn to scale. Behavioral Security Update Releases (CPU), 8u75, 8u81, 8u85, … Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 13 Platform Release Compatibility Region Binary Behavioral Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 14 Platform Release Compatibility Region Platform Release, JDK 8 GA, JDK 9 GA Binary Note: Figure not drawn to scale. Behavioral Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 14 Example: changing the iteration order of HashSet • Specification of HashSet.iterator() : “Returns an iterator over the elements in this set. The elements are returned in no particular order.” • Changing iteration order is allowed by the specification and: • Binary compatible (same set of methods) • Source compatible (same set of methods) • But a change in behavioral compatibility change; people can and do implicitly rely on iteration order • Therefore, this kind of change generally wouldn’t be made in either kind of update release, but would be (and has been) made in a platform release. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 15 Check the release notes and compatibility guides • Use source, binary, behavioral categorization • Compatibility guides distinguish between • Java SE incompatibilities • JDK incompatibilities • JDK 8 Compatibility Guide discusses changing the order of methods returned by Class.getMethods() • (JDK 9 guide expected later in the release) • See also: The Science and Art of Backward Compatibility [CON5773], Ian Robertson, Tuesday, Sep 20, 12:30 pm – 1:30 pm Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 16 How is JDK 9 different? • Same general model, but to support adding modularity, larger compatibility impact than usual allowed, including behavioral incompatibilities • Certain build artifacts going away; no more rt.jar! • Driven by modularity, even breaking binary compatibility in very select cases by removing ill-placed APIs including: • Break unfortunate dependencies on Java Beans, part of the java.desktop module: • java.util.logging.LogManager.{add, remove}PropertyChangeListener • java.util.jar.Pack200.Packer/Unpacker.{add, remove}PropertyChangeListener • Also: java.awt.Component.getPeer removed since it referred to ComponentPeer types outside of Java SE • More muscular deprecation policy with better tools to manage and inform Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 17 Outline • Stewardship and platform evolution • Tooling improvements • Language changes • Library updates • Q & A Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 18 jshell Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 19 A historical perspective on REPL • Lisp systems decades back provided a read-evaluate-print-loop (REPL) to interact with the language • Similar functionality is found in Ruby and Python as well as Scala, Groovy, and Clojure • What about Java? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 20 jshell – new command in $JDK/bin in JDK 9 OpenJDK Project Kulla/JEP 222: jshell: The Java Shell (Read-Eval-Print Loop) Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 21 jshell – new command in $JDK/bin in JDK 9 OpenJDK Project Kulla/JEP 222: jshell: The Java Shell (Read-Eval-Print Loop) • Teaser Demo • Less ceremony for students learning Java • Less formal way for experienced developers to • Explore using a new API • Experiment with new language features • Leverages many existing JDK technologies • For more information see: JShell: An Interactive Shell for the Java Platform [CON7643], Robert Field, Wednesday, Sep 21, 10:00 am – 11:00 am Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 21 JavaDoc.Next http://openjdk.java.net/projects/javadoc-next/ Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 22 HTML 5 JEP 224: HTML5 Javadoc • The javadoc tool has historically generated HTML 4.01 output • HTML 5 is a new HTML standard, finalized October 2014 • Richer semantic structure • New attributes defined • Use javadoc -html5 … to opt-into the new output • (Still uses frames-style layout) HTML 5 logo from www.w3.org/html/logo/index.html from 5 HTMLlogo Copyright © 2016, Oracle and/or its affiliates. All rights reserved. 23 Configuring doclint • Doclint checks can be run as part of javadoc or as part of javac; (both used in JDK build) • HTML
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages162 Page
-
File Size-