Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Java Day Tokyo 2017 Feedback - Java SE (Japanese)

Java Day Tokyo 2017 Feedback - Java SE (Japanese)

Summary of Java SE related topics delivered at Java Day Tokyo 2017.

Akihiro Nishikawa

July 11, 2017
Tweet

More Decks by Akihiro Nishikawa

Other Decks in Technology

Transcript

  1. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Java Day Tokyo 2017 Feedback Java SE Akihiro Nishikawa Cloud Technology Business Unit Oracle Corporation Japan July 11, 2017
  2. Copyright © 2017, 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. 2
  3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Program Agenda JDK 9 New Features Migration to Java 9 Key takeaway 1 2 3 3
  4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 5 Process API Updates HTTP 2 Client Improve Contended Locking Unified JVM Logging Compiler Control Variable Handles Segmented Code Cache Smart Java Compilation, Phase Two The Modular JDK Modular Source Code Elide Deprecation Warnings on Import Statements Resolve Lint and Doclint Warnings Milling Project Coin Remove GC Combinations Deprecated in JDK 8 Tiered Attribution for javac Process Import Statements Correctly Annotations Pipeline 2.0 Datagram Transport Layer Security (DTLS) Modular Run-Time Images Simplified Doclet API jshell: The Java Shell (Read-Eval-Print Loop) New Version-String Scheme HTML5 Javadoc Javadoc Search UTF-8 Property Files Unicode 7.0 Add More Diagnostic Commands Create PKCS12 Keystores by Default Remove Launch-Time JRE Version Selection Improve Secure Application Performance Generate Run-Time Compiler Tests Automatically Test Class-File Attributes Generated by javac Parser API for Nashorn Linux/AArch64 Port Multi-Release JAR Files Remove the JVM TI hprof Agent Remove the jhat Tool Java-Level JVM Compiler Interface TLS Application-Layer Protocol Negotiation Extension Validate JVM Command-Line Flag Arguments Leverage CPU Instructions for GHASH and RSA Compile for Older Platform Versions Make G1 the Default Garbage Collector OCSP Stapling for TLS Store Interned Strings in CDS Archives Multi-Resolution Images Use CLDR Locale Data by Default Prepare JavaFX UI Controls & CSS APIs for Modularization Compact Strings Merge Selected Xerces 2.11.0 Fixes into JAXP BeanInfo Annotations Update JavaFX/Media to Newer Version of GStreamer HarfBuzz Font-Layout Engine Stack-Walking API Encapsulate Most Internal APIs Module System TIFF Image I/O HiDPI Graphics on Windows and Linux Platform Logging API and Service Marlin Graphics Renderer More Concurrency Updates Unicode 8.0 XML Catalogs Convenience Factory Methods for Collections Reserved Stack Areas for Critical Sections Unified GC Logging Platform-Specific Desktop Features DRBG-Based SecureRandom Implementations Enhanced Method Handles Modular Java Application Packaging Dynamic Linking of Language-Defined Object Models Enhanced Deprecation Additional Tests for Humongous Objects in G1 Improve Test-Failure Troubleshooting Indify String Concatenation HotSpot C++ Unit-Test Framework jlink: The Java Linker Enable GTK 3 on Linux New HotSpot Build System Spin-Wait Hints SHA-3 Hash Algorithms Disable SHA-1 Certificates Deprecate the Applet API Filter Incoming Serialization Data Implement Selected ECMAScript 6 Features in Nashorn Linux/s390x Port JDK 9
  5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | JDK 9 Features and Enhancements • "Project Jigsaw" – Java Platform Module System • "Project Kulla" – JShell (REPL Tool for Java Platform) • AOT (Ahead-of-Time) Compilation • Concurrency Updates • Process API Updates • Factory Methods for Collections • Milling Project Coin, ...etc. 6
  6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | JDK 9 Features and Enhancements • "Project Jigsaw" – Java Platform Module System • "Project Kulla" – JShell (REPL Tool for Java Platform) • AOT (Ahead-of-Time) Compilation • Concurrency Updates • Process API Updates • Factory Methods for Collections • Milling Project Coin, ...etc. 7
  7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | "Project Jigsaw" – Java Platform Module System 8 JSR 376: Java Platform Module System http://openjdk.java.net/projects/jigsaw/spec/
  8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  • -<LFMBLA*#52.%) – Java SE 20(/ "HCK=@: – $-8EK;M=IL-/.EJ@AD9MG/<LFMBLA"-'N • API API7.%) –  &5JAR1-JAR"6!4+3 – 7 %,API7% !3/8:?>7%) 9
  9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  • public • protected • <package> • private 10 JDK 8
  10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  • public • protected • <package> • private 11 JDK 8 publicpublic  API ...
  11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | "#%$&Module'  •   ! % •  module-info.java 12
  12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | src/module-info.java module <name> { requires <Module>; exports <package>( to <Module>); } 13          
  13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | src/module-info.java module <name> { requires <Module>; exports <package>( to <Module>); uses <Service>; provides <Service> with <Impl>; } 14    SPI      SPI
  14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | • public • protected • <package> • private •  public (exports) •   public (exports xxx to xxx) •   public (public) • protected • <package> • private 15 JDK 8  JDK 9
  15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 12 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 16 $ • !"&%#  •   "$  16
  16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  Hello world // com.example.hello.SayHello.java package com.example.hello; import java.lang.*; public class SayHello { public static void main(String... args) { System.out.println("Hello Jigsaw!"); } } 17 "com.example.hello" 
  17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 18   hello.world com.example.hello None java.base java.base java.lang java.io java.net java.util com.sun.crypto.provider sun.nio.ch sun.reflect.annotation sun.security.provider None com.example. hello     
  18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  module hello.world { exports com.example.hello; requires java.base; } 19 module-info.java hello.world.jar module-info.class com/example/hello/ SayHello.class java.base     
  19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 21 module-info.java src com/example/hello SayHello.java module-info.java
  20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 26 public java.base  export   java.base 
  21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 9 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | jlink • &'+)!"   $(* $ %+  #) • JEP –261: Module System (Link Time) –275: Modular Java Application Packaging 27 JEP 282: The Java Linker
  22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | JShell – REPL Tool for Java Platform JEP 222: jshell: The Java Shell (Read-Eval-Print Loop) 28
  23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | JShell 29 JavaRead-Evaluate-Print Loop (REPL) 
  24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Use case • API  •   •   • etc... 30
  25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Java,+& ' • !2 *(* API,/5#' 36@C8F ;BE->F<BEN( $4.9E?7D#*"'0>F<BE GN+1H( $3 ,API –JCP standard Gjava.* 1 javax.*H –JDK-specific API G, com.sun.* 1 jdk.* • :AF=,API5$3 )#'%+ $3 33
  26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | • 3FL9O;JN/% – JDK!API0# – KN>5G5HO<0  – (&CO<JN – _ P3N?O=:3Q100  – $API1Extension0" – $GC7F;JN0 )2" –  .7F;JN2',JVM2 (+ • BKEM;IO@4N8/% – GC Log0  • *0 – AD6MBGC0  34 JDK 9-00.& P!Q
  27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | JDKAPI • JDKAPI "! –  Public APIAPI "! • JDKAPI #$  36 JEP 260: Encapsulate most internal APIs
  28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | "# sun.misc.*  sun.reflect.* ! • public API   jdk.unsupported%$&)' *JDK 10( + – sun.misc.Unsafe – sun.misc.{Signal,SignalHandler} – sun.misc.Cleaner – sun.reflect.Reflection::getCallerClass – sun.reflect.ReflectionFactory •  sun.{misc,reflect} API ! – ,sun.misc.Base64 37
  29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 38 jdk.unsupported jdk.unsupported sun.misc sun.reflect None java.base java.lang java.io java.net java.util java.security com.sun.crypto.provider com.sun.org.apache.xerces.internal.jaxp sun.nio.ch sun.net.www sun.reflect.annotation sun.security.x509
  30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | jdeps (Java Dependency Analysis Tool) • JDK 9jdeps  API •  API 40 https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool <JDK9_HOME>/bin/jdeps –jdkinternals <Class/JAR>
  31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 41 import sun.misc.BASE64Encoder; import sun.misc.BASE64Decoder; import java.io.IOException; public class Base64 { public String decodeBase64(byte[] buf) throws IOException { return (new BASE64Encoder()).encode(buf); } public byte[] decodeBase64(String str) throws IOException { return (new BASE64Decoder()).decodeBuffer(str); } }
  32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Java'"& JAR % • Java$$''"&#1'!   JAR % • MANIFEST.MF – Multi-Release: true 43 JEP 238: Multi-Release JAR files
  33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 44  JDK 8JDK 9  Multi-Release JAR JAR Content Root A.class B.class C.class META-INF MANIFEST.MF versions 9 A.class B.class
  34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 45 JDK 8 JDK 9  Multi-Release JAR JAR Content Root A.class B.class C.class META-INF MANIFEST.MF versions 9 A.class B.class JDK 8/9 JDK 8  JDK 9  Manifest-Version: 1.0 Created-By: 9-ea (Oracle Corporation) Main-Class: PrintPID Multi-Release: true
  35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 49)#1#2;' >? • JDK  • JDK,"7$-5 . #6 <rt.jartools.jar= • $4(8;*; – -Xbootclasspath/p  – !05%;&39$4(8;*URLClassLoader#9()9(  – /;-(-4+0:$4(8;*JDK$4(  46 JEP 220: Modular Run-Time Images
  36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 47 JDK 8 JDK 9 bin jre lib bin lib tools.jar rt.jar bin conf lib JDK 9  • re   • rt.jar • tools.jar
  37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |    $MAJOR.$MINOR.$SECURITY 48 JEP 223 : New Version-String Scheme     Early Access 1.9.0-ea-b19 9-ea 9-ea+19 9-ea Major 1.9.0-b100 9 9+100 9 CPU 1.9.0_5-b20 9u5 9.0.1+20 9.0.1 Minor 1.9.0_20-b62 9u20 9.1.2+62 9.1.2
  38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  #*') •  &%($   • #*')*" ! – java.lang.Runtime.Version – GA#*') 9.0.01.9.0 9 49
  39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | _ 1  • Lambda  • Java 8   50 Milling Project Coin
  40. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | API java.util.logging.LogManager.addPropertyChangeListener java.util.logging.LogManager.removePropertyChangeListener java.util.jar.Pack200.Packer.addPropertyChangeListener java.util.jar.Pack200.Packer.removePropertyChangeListener java.util.jar.Pack200.Unpacker.addPropertyChangeListener java.util.jar.Pack200.Unpacker.removePropertyChangeListener java.awt.Component.getPeer ... 51 
  41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Extension Mechanism Endorsed Standards • "(#'  %)$! JVM   – ${java.home}/lib/ext – ${java.home}/lib/endorsed – java.ext.dirsjava.endorsed.dirs !&%)$! 52 Java 8 
  42. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Extension MechanismEndorsed Standards • JDK 8u40 -XX:+CheckEndorsedAndExtDirs  extension   • &*#/0' +$,0. JAR)!."-%(%  53
  43. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | GC  •    GC  Java 8  JEP 173 • Incremental CMS (iCMS)   JEP 214: Remove GC Combinations Deprecated in JDK 8 54 G1 CMS Serial Parallel Parallel Scavenge DefNew ParNew G1 ParOld Serial Old CMS G1 iCMS Full GC
  44. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | GC   DefNew + CMS -XX:-UseParNewGC -XX:+UseConcMarkSweepGC ParNew + SerialOld -XX:+UseParNewGC ParNew + iCMS -Xincgc ParNew + iCMS -XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC DefNew + iCMS -XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC -XX:-UseParNewGC CMS Foreground -XX:+UseCMSCompactAtFullCollection CMS Foreground -XX:+CMSFullGCsBeforeCompaction CMS Foreground -XX:+UseCMSCollectionPassing  GC    JEP 214: Remove GC Combinations Deprecated in JDK 8
  45. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |     JEP 271: Unified GC Logging/GC   57
  46. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  •    •     • &#% "!$ 58
  47. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | JEP 271: Unified GC Logging • JVM Unified Logging Framework $-&"$ – %('*-&,)+" – . . " • jcmd$ !#-&" $   59 JEP 158: JVM Unified Logging Framework"
  48. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  -Xlog:gc*=debug :file=/u01/app/oracle/gc.log :time,level,tags :filecount=10,filesize=30M 60  1
  49. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | 61 ' < '13+72* ',:5"!$= Syntax –Xlog[:[what][:[output][:[decorators][:output-options]]]] what  */-# 847" /->all, gc, exceptions, os, thread, class, vmoperation, age, alloc, event, ... 847>off, trace, debug, info, warning, error output  stdout / stderr / file=<path to file> decorators 9-% )(  uptime, level, tags, time, utctime, tilemillis, timenanos, hostname, ... output-options 9-9;0;.6: & filecount=n,filesize=m 13+72'n=5m=20M
  50. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Java 9 62  1 Java 8  Java 9 -Xloggc:/path/to/gc_%p_%t.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20M -XX:NumberOfGCLogFIles=7 Java 8 -Xlog:gc*=debug:/path/to/gc_%p_%t.log:time,level, tags:filesize=20M,filecount=7
  51. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |     % jcmd <pid> VM.log output="file=/path/to/gc_%p_%t.log" output_options="filecount=7,filesize=200m" what="gc*=debug" decorators="time,lebel,tags" <pid>: Command executed successfully % jcmd <pid> VM.log disable <pid>: Command executed successfully 63 PID 
  52. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    |  JEP 248: Make G1 the Default Garbage Collector /   GC 64
  53. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | &(#-'GC • &(#-'GCParallel GCG1 GC • Parallel GC"     • CMS /JEP 2910 •  – 32-bit Windows Serial GC&(#-' – G1 $*.'!),%'(#.+  65 JEP 248: Make G1 the Default Garbage Collector
  54. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Summary • JDK 924 )3!7!,598 • E>FHG2+(JDK3&%3 7API3 (' , *8-6( =HC3$," –JDK 97Project Jigsaw3;<@?DGC:./A?B –Multi-Release JAR10:+(3:# 67
  55. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Information • GA –2017921 • JDK 9 Early Access Build –http://jdk.java.net/9/ • JDK 9 Documentation Early Access –http://docs.oracle.com/javase/9/ • Migration Guide –http://docs.oracle.com/javase/9/migrate/toc.htm 68
  56. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.

    | Safe Harbor Statement The preceding 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. 69