SlideShare ist ein Scribd-Unternehmen logo
1 von 41
© Copyright Azul Systems 2017
© Copyright Azul Systems 2015
@speakjava
55 New Features
In JDK 9
Simon Ritter
Deputy CTO, Azul Systems
1
© Copyright Azul Systems 2017
Major Features
© Copyright Azul Systems 2017
Java Platform Module System JSR 376
Public Review Reconsideration Ballot
© Copyright Azul Systems 2017
Modularity/Jigsaw
 Standard class libraries modularised (JEP 220)
– JDK now 94 modules
 Most internal APIs now encapsulated (JEP 260)
– sun.misc.Unsafe
– Some can be used with command line options
 --add-exports
 --add-opens
 Modular source code (JEP 201)
– JDK source code re-organised to support modules
– Not the module system
4
© Copyright Azul Systems 2017
Modularity/Jigsaw
 Compatability is an issue
– Mostly for libraries and frameworks
– Which most people use
– Override encapsulation of private APIs
 Leave everything on classpath to start with
 “Big kill switch” now has options
– Turns off encapsulation completely by default
– --illegal-access={permit,warn,debug,deny}
5
© Copyright Azul Systems 2017
jlink: The Java Linker (JEP 282)
6
Modular run-time
image
…confbin
jlink
$ jlink --modulepath $JDKMODS 
--addmods java.base –output myimage
$ myimage/bin/java –-list-modules
java.base@9.0
jmods
© Copyright Azul Systems 2017
jlink: The Java Linker (JEP 282)
$ jlink --module-path $JDKMODS:$MYMODS 
--addmods com.azul.app –-output myimage
$ myimage/bin/java –-list-modules
java.base@9.0
java.logging@9.0
java.sql@9.0
java.xml@9.0
com.azul.app@1.0
com.azul.zoop@1.0
com.azul.zeta@1.0
Version numbering for
information purposes only
“It is not a goal of the module
system to solve the version-
selection problem”
© Copyright Azul Systems 2017
Factory Methods For Collections (JEP 269)
 Static factory methods on List, Set and Map interfaces
– Create compact, immutable instances
– 0 to 10 element overloaded versions
– Plus varargs version for arbitary number of elements
8
Set<String> set = new HashSet<>();
set.add("a");
set.add("b");
set.add("c");
set = Collections.unmodifiableSet(set);
Set<String> set = Set.of("a", "b", "c");
© Copyright Azul Systems 2017
Stream Enhancements
 dropWhile()/takeWhile()
– Like skip/limit but uses Predicate rather than number
 Improved iterate
– Enables a stream to be more like a for loop
 Parallel Files.lines()
– Memory mapped, divided on line break boundary
 Stream from Optional
– Stream of zero or one element
9
© Copyright Azul Systems 2017
Multi-Release Jar Files (JEP 238)
 Multiple Java release-specific class files in a single archive
 Enhance jar tool to create multi-release files
 Support multi-release jar files in the JRE
– Classloaders
– JarFile API
 Enhance other tools
– javac, javap, jdeps, etc.
 Also, modular jar files
10
© Copyright Azul Systems 2017
REPL: jshell (JEP 222)
 Read-Eval-Print Loop
– Simple prototyping
11
© Copyright Azul Systems 2017
Concurrency Updates (JEP 266)
 Reactive streams publish-subscribe framework
 Asynchronous, non-blocking
 Flow
– Publisher, Subscriber, Processor, Subscription
 SubmissionPublisher utility class
– Asynchronously issues items to current subscribers
– Implements Flow.Processor
12
© Copyright Azul Systems 2017
Concurrency Updates (JEP 266)
 CompletableFuture additions
– Delays and timeouts
– Better support for sub-classing
– New static utility methods
 minimalCompletionStage
 failedStage
 newIncompleteFuture
 failedFuture
13
© Copyright Azul Systems 2017
Enhanced Deprecation (JEP 277)
 We have @deprecated and @Deprecated
– Used to cover too many situations
 New methods in Deprecated annotation
– boolean forRemoval()
 Will this ever be removed?
– String since()
 JDK Version when this was deprecated
 Several @Deprecated tags added
– java.awt.Component.{show(),hide()} removed
 jdeprscan command to produce report
14
© Copyright Azul Systems 2017
Milling Project Coin (JEP 213)
 Single underscore no longer valid as identifier
– Ready for use in Lambdas
 Private methods in interfaces
– Multiple inheritance of behaviour makes this logical
 Effectively final variables in try-with-resources
– Variables from outside try block
 Allow @SafeVarargs on private instance methods
– In addition to constructors, final and static methods
 Diamond operator with anonymous classes
– Extending type inference further
15
© Copyright Azul Systems 2017
Standards
© Copyright Azul Systems 2017
Updating To Relevant Standards
 Unicode 7.0/8.0 (JEP 227/267)
– 7.0: 2,834 new characters
– 8.0: 7,716 new characters
 PKCS12 key stores by default (JEP 229)
– Move from JKS to PKCS12
 HTML5 javadocs (JEP 224)
– Flashier documentation
 SHA 3 hash algorithms (JEP 287)
– Keeping ahead of the hackers
17
}seriously!
© Copyright Azul Systems 2017
Smaller Features
 UTF-8 property files (JEP 226)
– ResourceBundle API updated to load these files
 DRBG-Based SecureRandom implementations (JEP 273)
– Deterministic Random Bit Generator
 XML Catalog API (JEP 268)
– Supports OASIS XML catalog API v1.1
– For use with JAXP
18
© Copyright Azul Systems 2017
Inside The JVM
© Copyright Azul Systems 2017
Default Collector: G1 (JEP 248)
 G1 now mature in development
 Designed as low-pause collector
 Concurrent class unloading (JEP 156) JDK8u40
– Useful enhancement to improve G1
 Still falls back to full compacting collection
– Pause times proportional to heap size
– Use Zing from Azul for truly pauseless
20
© Copyright Azul Systems 2017
Better String Performance
 Compact strings (JEP 254)
– Improve the space efficiency of the String class
– Not using alternative encodings
 Store interned strings in CDS archive (JEP 250)
– Share String and char[] objects between JVMs
 Indify String concatenation (JEP 280)
– Change from static String-concatenation bytecode
sequence to invokedynamic
– Allow future performance improvements
21
© Copyright Azul Systems 2017
Marlin Graphics Renderer (JEP 265)
 Replaces Pisces open-source renderer
– Comparable performance to closed-source Ductus
22
© Copyright Azul Systems 2017
Smaller Features
 Improve contended locking (JEP 143)
– Field reordering/cache line alignment
 Leverage CPU instructions for GHASH and RSA (JEP 246)
– 34-150x better performance (for certain tests)
 Update JavaFX to newer version of GStreamer (JEP 257)
– Media class
– Better security, stability and performance
23
© Copyright Azul Systems 2017
Smaller Features
 Segmented Code Cache (JEP 197)
– Separate non-method, profiled and non-profiled code
 Unified JVM logging (JEP 158)
– Common logging system for all components of JVM
 Unified GC logging (JEP 271)
– Re-implement GC logging using unified JVM logging
– Many command line options changed
24
© Copyright Azul Systems 2017
Specialised
© Copyright Azul Systems 2017
Spin-Wait Hints (JEP 285)
 Proposed by Azul
– We rock!
 A new method for Thread class
– onSpinWait()
 Enables the x86 PAUSE instruction to be used from Java
code
– If available
– Ignored otherwise
– Improved performance for things like Disruptor
26
© Copyright Azul Systems 2017
Variable Handles (JEP 193)
 Replacement for parts of sun.misc.Unsafe
 Fence operations
– Fine grained memory control
– Atomic operations on object fields and array elements
 VarHandle
– compareAndExchange(), compareAndSet()
– getAndAdd(), getAndSet()
– acquireFence(), releaseFence()
27
© Copyright Azul Systems 2017
Enhanced Method Handles (JEP 274)
 Support for
– loops
– try/finally blocks
 Better argument handling
– Spreading
– Collection
– Folding
 More lookup functions
– Non-abstract methods in interfaces, classes
28
© Copyright Azul Systems 2017
Smaller Features
 Compiler control (JEP 165)
– Control of C1/C2 JIT, not javac
– Directive file
– Runtime changes via jcmd
 Process API updates (JEP 102)
– Native process (Process/ProcessHandle)
– More information: pid, arguments, start time, CPU usage,
name
– Control subject to security manager permissions
29
© Copyright Azul Systems 2017
Housekeeping
© Copyright Azul Systems 2017
New Version String Format (JEP 223)
 Old
– Limited update release/Critical patch update (CPU)
– Download: Java SE 8u131, java -version: jdk1.8.0_131
– Which has more patches, JDK 7u55 or JDK 7u60?
 New
– JDK $MAJOR.$MINOR.$SECURITY.$PATCH
– Easy to understand by humans and apps
– Semantic versioning
31
© Copyright Azul Systems 2017
JDK/JRE File Structure (JEP 220)
32
bin
Pre-JDK 9 JDK 9
lib
tools.jar
jre
bin
rt.jar
lib
libconfbin
jre directory
tools.jar
rt.jar
jmods
© Copyright Azul Systems 2017
Smaller Features
 Searchable API documentation (JEP 225)
– Finally! Java API docs enter the 21st century
 Annotations pipeline 2.0 (JEP 217)
– Repeating, type and Lambda annotations in JDK 8
– Redesign of javac annotation pipeline
 Parser API for Nashorn (JEP 236)
– API for Nashorn abstract tree syntax
– Nashorn implements ECMAScript 5.1 spec.
33
© Copyright Azul Systems 2017
General Clean Up
 Disable SHA-1 certificates (JEP 288)
– Mostly
 In some situations SHA-1 certs. will still be accepted
 Deprecate the Applet API (JEP 289)
– Not many people still use this
34
© Copyright Azul Systems 2017
Removed From JDK 9
 Six deprecated APIs (JEP 162)
– {Add,Remove}ActionListener
– Pack200, Unpack200 and LogManager
 com.sun.security.auth.callback.DialogCallbackHandle
r
– Part of JAAS
 JRE version selection command line option (JEP 231)
– -version:release no longer accepted
– -version still works
 Demos and samples (JEP 298)
– Out-of-date, unmaintained 35
© Copyright Azul Systems 2017
Removed From JDK 9
 JVM TI hprof agent (JEP 240)
– Only ever intended as a demo of JVM TI
– Useful features now in other tools (like jmap)
 Remove the jhat tool (JEP 241)
– Experimental tool added in JDK 6
– Unsupported
– Better heap visualisation tools available
36
© Copyright Azul Systems 2017
Removed GC Options (JEP 214)
 Deprecated in JDK 8 (JEP 173)
37
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
© Copyright Azul Systems 2017
Summary
© Copyright Azul Systems 2017
JDK 9
 Big new feature is modularity
– Covers numerous different areas
– Modules, jink, etc.
 Smaller developer features
– New APIs for streams
– Reactive API
– REPL/jshell
 Many smaller performance/standards features
 Time to start testing, if you’re not already
40
© Copyright Azul Systems 2017
Zulu Java
 Azul’s binary distribution of OpenJDK
– Passes all TCK tests
– Multi-platform (Windows, Linux, Mac)
– FREE!
 Happy to sell you support, including older versions
 JDK 6, 7, 8 and 9 (Early Access)
41
www.zulu.org/download
© Copyright Azul Systems 2017
© Copyright Azul Systems 2015
@speakjava
Thank You
Survey:
bit.ly/AZULJDK9
Simon Ritter
Deputy CTO, Azul Systems
43

Weitere ähnliche Inhalte

Was ist angesagt?

Java Support: What's changing
Java Support:  What's changingJava Support:  What's changing
Java Support: What's changingSimon Ritter
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesikmfrancis
 
Servlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesServlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesVMware Tanzu
 
Spring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in ActionSpring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in ActionJohn Blum
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoringSimon Ritter
 
Apache Geode (incubating) Introduction with Docker
Apache Geode (incubating) Introduction with DockerApache Geode (incubating) Introduction with Docker
Apache Geode (incubating) Introduction with DockerWilliam Markito Oliveira
 
OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010
OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010
OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010Adrian Trenaman
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?Azul Systems Inc.
 
BeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 SpecificationBeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 SpecificationStijn Van Den Enden
 
SK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin SummitSK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin SummitJaesuk Ahn
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Bobby Curtis
 
Oem12c patching -OOW13
Oem12c patching -OOW13Oem12c patching -OOW13
Oem12c patching -OOW13Bobby Curtis
 
5 Keys to Oracle GoldenGate Implemenations
5 Keys to Oracle GoldenGate Implemenations5 Keys to Oracle GoldenGate Implemenations
5 Keys to Oracle GoldenGate ImplemenationsBobby Curtis
 
“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the CoreC4Media
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cConnor McDonald
 

Was ist angesagt? (20)

Java Support: What's changing
Java Support:  What's changingJava Support:  What's changing
Java Support: What's changing
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
 
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
 
Servlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesServlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use Cases
 
Spring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in ActionSpring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in Action
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
OSGi & Blueprint
OSGi & BlueprintOSGi & Blueprint
OSGi & Blueprint
 
Apache Geode (incubating) Introduction with Docker
Apache Geode (incubating) Introduction with DockerApache Geode (incubating) Introduction with Docker
Apache Geode (incubating) Introduction with Docker
 
OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010
OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010
OSGi for real in the enterprise: Apache Karaf - NLJUG J-FALL 2010
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
BeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 SpecificationBeJUG Meetup - What's coming in the OSGi R7 Specification
BeJUG Meetup - What's coming in the OSGi R7 Specification
 
SK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin SummitSK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin Summit
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)
 
Javantura v4 - JVM++ The GraalVM - Martin Toshev
Javantura v4 - JVM++ The GraalVM - Martin ToshevJavantura v4 - JVM++ The GraalVM - Martin Toshev
Javantura v4 - JVM++ The GraalVM - Martin Toshev
 
Oem12c patching -OOW13
Oem12c patching -OOW13Oem12c patching -OOW13
Oem12c patching -OOW13
 
5 Keys to Oracle GoldenGate Implemenations
5 Keys to Oracle GoldenGate Implemenations5 Keys to Oracle GoldenGate Implemenations
5 Keys to Oracle GoldenGate Implemenations
 
Exachk and oem12c
Exachk and oem12cExachk and oem12c
Exachk and oem12c
 
OpenStack Heat
OpenStack HeatOpenStack Heat
OpenStack Heat
 
“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core“Quantum” Performance Effects: beyond the Core
“Quantum” Performance Effects: beyond the Core
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12c
 

Ähnlich wie JDK 9: 55 New Features

55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9VMware Tanzu
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Anna Shymchenko
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12Simon Ritter
 
Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Kevin Sutter
 
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"GlobalLogic Ukraine
 
Java History - MyExamCloud Presentation
Java History - MyExamCloud PresentationJava History - MyExamCloud Presentation
Java History - MyExamCloud PresentationGanesh P
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8Simon Ritter
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?Azul Systems, Inc.
 
Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynoteSuyash Joshi
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...Jesse Gallagher
 
Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Community
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cooljavablend
 
Online patching ebs122_aioug_appsdba_nov2017
Online patching ebs122_aioug_appsdba_nov2017Online patching ebs122_aioug_appsdba_nov2017
Online patching ebs122_aioug_appsdba_nov2017pasalapudi
 
Oracle rac 10g best practices
Oracle rac 10g best practicesOracle rac 10g best practices
Oracle rac 10g best practicesHaseeb Alam
 

Ähnlich wie JDK 9: 55 New Features (20)

55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
 
Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1
 
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
 
Java History - MyExamCloud Presentation
Java History - MyExamCloud PresentationJava History - MyExamCloud Presentation
Java History - MyExamCloud Presentation
 
GlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and FutureGlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and Future
 
Java SE 8 & EE 7 Launch
Java SE 8 & EE 7 LaunchJava SE 8 & EE 7 Launch
Java SE 8 & EE 7 Launch
 
ch22.ppt
ch22.pptch22.ppt
ch22.ppt
 
PROSE
PROSEPROSE
PROSE
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
Java dev mar_2021_keynote
Java dev mar_2021_keynoteJava dev mar_2021_keynote
Java dev mar_2021_keynote
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool
 
Java 7: Quo vadis?
Java 7: Quo vadis?Java 7: Quo vadis?
Java 7: Quo vadis?
 
Online patching ebs122_aioug_appsdba_nov2017
Online patching ebs122_aioug_appsdba_nov2017Online patching ebs122_aioug_appsdba_nov2017
Online patching ebs122_aioug_appsdba_nov2017
 
Oracle rac 10g best practices
Oracle rac 10g best practicesOracle rac 10g best practices
Oracle rac 10g best practices
 

Mehr von Simon Ritter

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native CompilerSimon Ritter
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type PatternsSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern JavaSimon Ritter
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVMSimon Ritter
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New FeaturesSimon Ritter
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDKSimon Ritter
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologySimon Ritter
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologySimon Ritter
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?Simon Ritter
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still FreeSimon Ritter
 
It's Java, Jim, but not as we know it
It's Java, Jim, but not as we know itIt's Java, Jim, but not as we know it
It's Java, Jim, but not as we know itSimon Ritter
 
Whats New For Developers In JDK 9
Whats New For Developers In JDK 9Whats New For Developers In JDK 9
Whats New For Developers In JDK 9Simon Ritter
 
Streams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The UglyStreams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The UglySimon Ritter
 

Mehr von Simon Ritter (19)

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern Java
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New Features
 
Java after 8
Java after 8Java after 8
Java after 8
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDK
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java Technology
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still Free
 
JDK 9 Deep Dive
JDK 9 Deep DiveJDK 9 Deep Dive
JDK 9 Deep Dive
 
It's Java, Jim, but not as we know it
It's Java, Jim, but not as we know itIt's Java, Jim, but not as we know it
It's Java, Jim, but not as we know it
 
Whats New For Developers In JDK 9
Whats New For Developers In JDK 9Whats New For Developers In JDK 9
Whats New For Developers In JDK 9
 
Streams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The UglyStreams: The Good, The Bad And The Ugly
Streams: The Good, The Bad And The Ugly
 

Kürzlich hochgeladen

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburgmasabamasaba
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 

Kürzlich hochgeladen (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

JDK 9: 55 New Features

  • 1. © Copyright Azul Systems 2017 © Copyright Azul Systems 2015 @speakjava 55 New Features In JDK 9 Simon Ritter Deputy CTO, Azul Systems 1
  • 2. © Copyright Azul Systems 2017 Major Features
  • 3. © Copyright Azul Systems 2017 Java Platform Module System JSR 376 Public Review Reconsideration Ballot
  • 4. © Copyright Azul Systems 2017 Modularity/Jigsaw  Standard class libraries modularised (JEP 220) – JDK now 94 modules  Most internal APIs now encapsulated (JEP 260) – sun.misc.Unsafe – Some can be used with command line options  --add-exports  --add-opens  Modular source code (JEP 201) – JDK source code re-organised to support modules – Not the module system 4
  • 5. © Copyright Azul Systems 2017 Modularity/Jigsaw  Compatability is an issue – Mostly for libraries and frameworks – Which most people use – Override encapsulation of private APIs  Leave everything on classpath to start with  “Big kill switch” now has options – Turns off encapsulation completely by default – --illegal-access={permit,warn,debug,deny} 5
  • 6. © Copyright Azul Systems 2017 jlink: The Java Linker (JEP 282) 6 Modular run-time image …confbin jlink $ jlink --modulepath $JDKMODS --addmods java.base –output myimage $ myimage/bin/java –-list-modules java.base@9.0 jmods
  • 7. © Copyright Azul Systems 2017 jlink: The Java Linker (JEP 282) $ jlink --module-path $JDKMODS:$MYMODS --addmods com.azul.app –-output myimage $ myimage/bin/java –-list-modules java.base@9.0 java.logging@9.0 java.sql@9.0 java.xml@9.0 com.azul.app@1.0 com.azul.zoop@1.0 com.azul.zeta@1.0 Version numbering for information purposes only “It is not a goal of the module system to solve the version- selection problem”
  • 8. © Copyright Azul Systems 2017 Factory Methods For Collections (JEP 269)  Static factory methods on List, Set and Map interfaces – Create compact, immutable instances – 0 to 10 element overloaded versions – Plus varargs version for arbitary number of elements 8 Set<String> set = new HashSet<>(); set.add("a"); set.add("b"); set.add("c"); set = Collections.unmodifiableSet(set); Set<String> set = Set.of("a", "b", "c");
  • 9. © Copyright Azul Systems 2017 Stream Enhancements  dropWhile()/takeWhile() – Like skip/limit but uses Predicate rather than number  Improved iterate – Enables a stream to be more like a for loop  Parallel Files.lines() – Memory mapped, divided on line break boundary  Stream from Optional – Stream of zero or one element 9
  • 10. © Copyright Azul Systems 2017 Multi-Release Jar Files (JEP 238)  Multiple Java release-specific class files in a single archive  Enhance jar tool to create multi-release files  Support multi-release jar files in the JRE – Classloaders – JarFile API  Enhance other tools – javac, javap, jdeps, etc.  Also, modular jar files 10
  • 11. © Copyright Azul Systems 2017 REPL: jshell (JEP 222)  Read-Eval-Print Loop – Simple prototyping 11
  • 12. © Copyright Azul Systems 2017 Concurrency Updates (JEP 266)  Reactive streams publish-subscribe framework  Asynchronous, non-blocking  Flow – Publisher, Subscriber, Processor, Subscription  SubmissionPublisher utility class – Asynchronously issues items to current subscribers – Implements Flow.Processor 12
  • 13. © Copyright Azul Systems 2017 Concurrency Updates (JEP 266)  CompletableFuture additions – Delays and timeouts – Better support for sub-classing – New static utility methods  minimalCompletionStage  failedStage  newIncompleteFuture  failedFuture 13
  • 14. © Copyright Azul Systems 2017 Enhanced Deprecation (JEP 277)  We have @deprecated and @Deprecated – Used to cover too many situations  New methods in Deprecated annotation – boolean forRemoval()  Will this ever be removed? – String since()  JDK Version when this was deprecated  Several @Deprecated tags added – java.awt.Component.{show(),hide()} removed  jdeprscan command to produce report 14
  • 15. © Copyright Azul Systems 2017 Milling Project Coin (JEP 213)  Single underscore no longer valid as identifier – Ready for use in Lambdas  Private methods in interfaces – Multiple inheritance of behaviour makes this logical  Effectively final variables in try-with-resources – Variables from outside try block  Allow @SafeVarargs on private instance methods – In addition to constructors, final and static methods  Diamond operator with anonymous classes – Extending type inference further 15
  • 16. © Copyright Azul Systems 2017 Standards
  • 17. © Copyright Azul Systems 2017 Updating To Relevant Standards  Unicode 7.0/8.0 (JEP 227/267) – 7.0: 2,834 new characters – 8.0: 7,716 new characters  PKCS12 key stores by default (JEP 229) – Move from JKS to PKCS12  HTML5 javadocs (JEP 224) – Flashier documentation  SHA 3 hash algorithms (JEP 287) – Keeping ahead of the hackers 17 }seriously!
  • 18. © Copyright Azul Systems 2017 Smaller Features  UTF-8 property files (JEP 226) – ResourceBundle API updated to load these files  DRBG-Based SecureRandom implementations (JEP 273) – Deterministic Random Bit Generator  XML Catalog API (JEP 268) – Supports OASIS XML catalog API v1.1 – For use with JAXP 18
  • 19. © Copyright Azul Systems 2017 Inside The JVM
  • 20. © Copyright Azul Systems 2017 Default Collector: G1 (JEP 248)  G1 now mature in development  Designed as low-pause collector  Concurrent class unloading (JEP 156) JDK8u40 – Useful enhancement to improve G1  Still falls back to full compacting collection – Pause times proportional to heap size – Use Zing from Azul for truly pauseless 20
  • 21. © Copyright Azul Systems 2017 Better String Performance  Compact strings (JEP 254) – Improve the space efficiency of the String class – Not using alternative encodings  Store interned strings in CDS archive (JEP 250) – Share String and char[] objects between JVMs  Indify String concatenation (JEP 280) – Change from static String-concatenation bytecode sequence to invokedynamic – Allow future performance improvements 21
  • 22. © Copyright Azul Systems 2017 Marlin Graphics Renderer (JEP 265)  Replaces Pisces open-source renderer – Comparable performance to closed-source Ductus 22
  • 23. © Copyright Azul Systems 2017 Smaller Features  Improve contended locking (JEP 143) – Field reordering/cache line alignment  Leverage CPU instructions for GHASH and RSA (JEP 246) – 34-150x better performance (for certain tests)  Update JavaFX to newer version of GStreamer (JEP 257) – Media class – Better security, stability and performance 23
  • 24. © Copyright Azul Systems 2017 Smaller Features  Segmented Code Cache (JEP 197) – Separate non-method, profiled and non-profiled code  Unified JVM logging (JEP 158) – Common logging system for all components of JVM  Unified GC logging (JEP 271) – Re-implement GC logging using unified JVM logging – Many command line options changed 24
  • 25. © Copyright Azul Systems 2017 Specialised
  • 26. © Copyright Azul Systems 2017 Spin-Wait Hints (JEP 285)  Proposed by Azul – We rock!  A new method for Thread class – onSpinWait()  Enables the x86 PAUSE instruction to be used from Java code – If available – Ignored otherwise – Improved performance for things like Disruptor 26
  • 27. © Copyright Azul Systems 2017 Variable Handles (JEP 193)  Replacement for parts of sun.misc.Unsafe  Fence operations – Fine grained memory control – Atomic operations on object fields and array elements  VarHandle – compareAndExchange(), compareAndSet() – getAndAdd(), getAndSet() – acquireFence(), releaseFence() 27
  • 28. © Copyright Azul Systems 2017 Enhanced Method Handles (JEP 274)  Support for – loops – try/finally blocks  Better argument handling – Spreading – Collection – Folding  More lookup functions – Non-abstract methods in interfaces, classes 28
  • 29. © Copyright Azul Systems 2017 Smaller Features  Compiler control (JEP 165) – Control of C1/C2 JIT, not javac – Directive file – Runtime changes via jcmd  Process API updates (JEP 102) – Native process (Process/ProcessHandle) – More information: pid, arguments, start time, CPU usage, name – Control subject to security manager permissions 29
  • 30. © Copyright Azul Systems 2017 Housekeeping
  • 31. © Copyright Azul Systems 2017 New Version String Format (JEP 223)  Old – Limited update release/Critical patch update (CPU) – Download: Java SE 8u131, java -version: jdk1.8.0_131 – Which has more patches, JDK 7u55 or JDK 7u60?  New – JDK $MAJOR.$MINOR.$SECURITY.$PATCH – Easy to understand by humans and apps – Semantic versioning 31
  • 32. © Copyright Azul Systems 2017 JDK/JRE File Structure (JEP 220) 32 bin Pre-JDK 9 JDK 9 lib tools.jar jre bin rt.jar lib libconfbin jre directory tools.jar rt.jar jmods
  • 33. © Copyright Azul Systems 2017 Smaller Features  Searchable API documentation (JEP 225) – Finally! Java API docs enter the 21st century  Annotations pipeline 2.0 (JEP 217) – Repeating, type and Lambda annotations in JDK 8 – Redesign of javac annotation pipeline  Parser API for Nashorn (JEP 236) – API for Nashorn abstract tree syntax – Nashorn implements ECMAScript 5.1 spec. 33
  • 34. © Copyright Azul Systems 2017 General Clean Up  Disable SHA-1 certificates (JEP 288) – Mostly  In some situations SHA-1 certs. will still be accepted  Deprecate the Applet API (JEP 289) – Not many people still use this 34
  • 35. © Copyright Azul Systems 2017 Removed From JDK 9  Six deprecated APIs (JEP 162) – {Add,Remove}ActionListener – Pack200, Unpack200 and LogManager  com.sun.security.auth.callback.DialogCallbackHandle r – Part of JAAS  JRE version selection command line option (JEP 231) – -version:release no longer accepted – -version still works  Demos and samples (JEP 298) – Out-of-date, unmaintained 35
  • 36. © Copyright Azul Systems 2017 Removed From JDK 9  JVM TI hprof agent (JEP 240) – Only ever intended as a demo of JVM TI – Useful features now in other tools (like jmap)  Remove the jhat tool (JEP 241) – Experimental tool added in JDK 6 – Unsupported – Better heap visualisation tools available 36
  • 37. © Copyright Azul Systems 2017 Removed GC Options (JEP 214)  Deprecated in JDK 8 (JEP 173) 37 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
  • 38. © Copyright Azul Systems 2017 Summary
  • 39. © Copyright Azul Systems 2017 JDK 9  Big new feature is modularity – Covers numerous different areas – Modules, jink, etc.  Smaller developer features – New APIs for streams – Reactive API – REPL/jshell  Many smaller performance/standards features  Time to start testing, if you’re not already 40
  • 40. © Copyright Azul Systems 2017 Zulu Java  Azul’s binary distribution of OpenJDK – Passes all TCK tests – Multi-platform (Windows, Linux, Mac) – FREE!  Happy to sell you support, including older versions  JDK 6, 7, 8 and 9 (Early Access) 41 www.zulu.org/download
  • 41. © Copyright Azul Systems 2017 © Copyright Azul Systems 2015 @speakjava Thank You Survey: bit.ly/AZULJDK9 Simon Ritter Deputy CTO, Azul Systems 43

Hinweis der Redaktion

  1. for loop syntax: initialiser, termination condition, interation action.
  2. forRemoval - Interesting. Tri-state (i.e. it may not be present on the annotation).
  3. Unicode 7: Lots of emojis, the Ruble symbol and Manat from Azerbaijan Unicode 8: Cherokee (lower case) some African languages and more emojis
  4. XML catalog is a document describing a mapping between extenal entity references and locallly cached equivalents. (Useful for things like DTDs)
  5. Concurrent class unloading means not having to do a full GC to unload classes Making G1 default may affect thruput Higher resource requirements Reasons to
  6. CDS = Class Data Sharing CDS = Class Data Sharing CDS = Class Data Sharing CDS = Class Data Sharing
  7. Segmented code cache to improve performance and allow future developments (Sumatra and the use of GPUs)
  8. MethodHandles utility class loop, countedLoop, whileLoop, tryFinally static methods spreading - arg array to individual args Collection - args to arg array Folding - Pre-prasing of arguments