1. New things in JDK 10
even that Scala-er should know
Scala Matsuri 2018
2018/3/18 Naoki Kishida (@kis )
2. Self Introduction
• Naoki Kishida
– @kis
– きしだのはてな
• Live in Fukuoka
• Server-side Java Developer at LINE Fukuoka
• I will talk about JDK 10 on JJUG Night Seminar
at 3/26, Tokyo.
3. JDK 10 will be released after 2 days
• JDK 10 will be released 2018/3/20
– with new release cycle.
4. Java new release cycle.
• Feature release every 6 months
– March and September
• Maintenance release every 3 months
– April and July for March release
– October and January for September release
• Long Term Support every 3 years
– The first LTS is JDK 11
• Oracle JDK will be for only Oracle Customer
– Use OpenJDK instead.
6. JDK 10 has 12 JEPs
• JEP
– Java Enhancement Proposal
– Same as Scala Improvement process(SIP)
http://openjdk.java.net/projects/jdk/10/
7. JEP Categories
• For JDK Developer
– 296: Consolidate the JDK Forest into a Single
Repository
– 304: Garbage-Collector Interface
– 317: Experimental Java-Based JIT Compiler
• For Java user
– 286: Local-Variable Type Inference
• Big thing for we Java developers
• But you don’t use Java
– No effect
– 313: Remove the Native-Header Generation
Tool(javah)
8. JEP Categories
• For JVM user
– 307: Parallel Full GC for G1
– 310: Application Class-Data Sharing
– 312: Thread-Local Handshakes
– 314: Additional Unicode Language-Tag Extentions
– 316: Heap Allocation on Alternative Memory
Devices
– 319: Root Certificates
– 322: Time-Based Release Versioning
9. 304: Garbage-Collector Integace
• GC is modularized.
• There are many GCs that will come.
– Epsilon GC
– ZGC
– Shenandoah
• Not to control GC by user code
10. 317: Experimental Java-Based JIT
Compiler
• Project Metoropolis
– java-on-java
• We can write JVM even with Scala?
– There is a possibility.
11. 286: Local-Variable Type Inferences
• var list = new ArrayList<String>()
• `var` is not a keyword
– but a special type
• We can use `var` as a variable name
• We can use `var` as a method name
• We can not use `var` as a class name
12. 307: Parallel Full GC for G1
• G1GC had been the default GC on JDK 9
• Full GC for G1 was not parallel.
• Until JDK 8, Parallel GC was the default
• To smooth migration, Full GC for G1GC also
parallelize.
• But full GC should not occur.
– Ideally, it has no effect for us.
13. 310: Application Class-Data Sharing
• CDS for system class is introduced in JDK 5
• Share class data between multiple JVM
on the same machine
– startup performance
– reduce the resource footprint
• JDK 10 allow to use CDS for application class
15. 314: Additional Unicode Language-Tag
Extentions
• Enhance java.util.Locale
• additional Unicode extensions
of BCP 47 language tag
– currency type
– the first day of the week
– region override
– time zone
16. 316: Heap Allocation on Alternative
Memory Devices
• Now we can use non-volatile RAM(不揮発性メ
モリ) such as 3D XPoint
• This will enable the JVM to use different types
of memory system
17. 319: Root Certificates
• OpenJDK doesn’t have Root Certificates so far
• Oracle JDK have had it.
• To smooth migration, OpenJDK have had it.
18. API Changes
• java.io.Reader
– long transferTo(Writer)
• java.lang.mainagement.RuntimeMXBean
– long getPid()
• java.util.List/Map/Set
– copyOf(Collection)
• java.util.stream.Collectors
– toUnmodifiableList/Set/Map
19. Docker aware
• Until JDK 9, JVM use the platform CPU
count/Memory size even if it is running on
Docker.
• JDK 10, JVM can use Docker setting for CPU
count/ Memory size if it is running on Docker.
• VM Options
– -XX:InitialRAMPercentage
– -XX:MaxRAMPercentage
– -XX:MinRAMPercentage
20. Other Changes
• Kerberos configuration file krb5.conf include
*.conf in INCLUDEDIR
• -d32 and –d64 has been removed
• new JavaDoc tag. {@summary}
• policytool has been removed
• XMLInputFactory.newFactory() has been “de-
deplicated”
– it had been deplicated by mistake.
21. What’s next?
• JDK 11 JEPs so far.
– 309: Dynamic Class-File Constants
– 318: Epsilon: An Arbitarily Low-Overhead Garbage
Collector
– 320: Remove the Java EE and CORBA Modules
– 323: Local-Variable Syntax for Lambda Parameters
22. References
• JDK 10
– http://openjdk.java.net/projects/jdk/10
• 109 New Features In JDK 10 - Azul Systems, Inc.
– https://www.azul.com/109-new-features-in-jdk-10/
• Java 10新機能まとめ - Qiita
– https://qiita.com/nowokay/items/d9bc4b3f715d17c2
830d
• Better containerized JVMs in JDK 10 - JAXenter
– https://jaxenter.com/better-containerized-jvms-jdk-
10-140593.html