Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JDK 9 New Features 4

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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/

Slide 9

Slide 9 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • -7%) 9

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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"

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 22 API …

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Demo 31

Slide 32

Slide 32 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migration to Java 9 32

Slide 33

Slide 33 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Java,+& ' • !2 *(* API,/5#' 36@C8F ;BE->FF

Slide 34

Slide 34 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • 3FL9O;JN/% – JDK!API0# – KN>5G5HO<0 – (&CO

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 39 macOS jdk.unsupported

Slide 40

Slide 40 text

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 /bin/jdeps –jdkinternals

Slide 41

Slide 41 text

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); } }

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 45 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 JDK 8/9 JDK 8 JDK 9 Manifest-Version: 1.0 Created-By: 9-ea (Oracle Corporation) Main-Class: PrintPID Multi-Release: true

Slide 46

Slide 46 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 49)#1#2;' >? • JDK • JDK,"7$-5. #6

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

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

Slide 56

Slide 56 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 56 JVM JVM

Slide 57

Slide 57 text

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

Slide 58

Slide 58 text

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

Slide 59

Slide 59 text

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"

Slide 60

Slide 60 text

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

Slide 61

Slide 61 text

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= 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

Slide 62

Slide 62 text

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

Slide 63

Slide 63 text

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

Slide 64

Slide 64 text

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

Slide 65

Slide 65 text

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

Slide 66

Slide 66 text

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Key Takeaway 66

Slide 67

Slide 67 text

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

Slide 68

Slide 68 text

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

Slide 69

Slide 69 text

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

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content