Java 9 New Features
Find the Java 9 New Features in short.
A. Changes in JDK 9
1. Introduces module, which is a named, self-describing collection of code and data.
2. (JEP 223) New Version-String Scheme $MAJOR.$MINOR.$SECURITY.$PATCH
B. New for Core Libraries in JDK 9
1. (JEP 102) Improves the API for controlling and managing operating system processes.
2. (JEP 193) Defines a standard means to invoke the equivalents of java.util.concurrent.atomic and sun.misc.Unsafe operations upon object fields and array elements.
3. (JEP 254) Adopts a more space-efficient internal representation for strings. Previously, the String class stored characters in a char array, using two bytes (16 bits) for each character. The new internal representation of the String class is a byte array plus an encoding-flag field.
4. (JEP 264) Defines a minimal logging API that platform classes can use to log messages, together with a service interface for consumers of those messages.
5. (JEP 266) Adds further concurrency updates to those introduced in JDK 8 in JEP 155: Concurrency Updates, including an interoperable publish-subscribe framework and enhancements to the CompletableFuture API.
6. (JEP 268) Adds a standard XML Catalog API that supports the Organization for the Advancement of Structured Information Standards (OASIS) XML Catalogs version 1.1 standard.
7. (JEP 269) Makes it easier to create instances of collections and maps with small numbers of elements. New static factory methods on the List, Set, and Map interfaces make it simpler to create immutable instances of those collections.
8. (JEP 274) Enhances the MethodHandle, MethodHandles, and MethodHandles.Lookup classes of the java.lang.invoke package to ease common use cases and enable better compiler optimizations.
9. (JEP 277) Revamps the @Deprecated annotation to provide better information about the status and intended disposition of an API in the specification such as @Deprecated(forRemoval=true) and @Deprecated(since="version")
10. (JEP 285) Defines an API that enables Java code to hint that a spin loop is executing.
11. (JEP 290) Allows incoming streams of object-serialization data to be filtered to improve both security and robustness.
12. (JEP 259) Provides a stack-walking API that allows easy filtering and lazy access to the information in stack traces.
13. (JEP 255) Updates the JDK to support the 2.11.0 version of the Xerces parser.
C. New for JDK 9 Installer
1. Provides the option to enable or disable web deployment in the Welcome page of the installer.
2. Provides notification on next CPU availability after uninstalling the current CPU version.
3. Enhanced user experience while updating the JRE.
D. New for Tools in JDK 9
1. (JEP 222) Adds Read-Eval-Print Loop (REPL) functionality to the Java platform.
2. (JEP 228) Defines additional diagnostic commands to improve the ability to diagnose issues with Hotspot and the JDK.
3. (JEP 231) Removes the ability to request a version of the JRE that is not the JRE being launched at launch time.
4. (JEP 238) Extends the JAR file format to enable multiple, Java release-specific versions of class files to coexist in a single archive.
5. (JEP 240) Removes the hprof agent from the JDK.
6. (JEP 241) Removes the jhat tool from the JDK.
7. (JEP 245) Validates arguments to all numerical JVM command-line flags to avoid failures and instead displays an appropriate error message if they are found to be invalid.
8. (JEP 247) Enhances javac so that it can compile Java programs to run on selected earlier versions of the platform.
9. (JEP 282) Assembles and optimizes a set of modules and their dependencies into a custom runtime image as defined in JEP 220.
E. New for Security in JDK 9
1. (JEP 219) Enables Java Secure Socket Extension (JSSE) API and the SunJSSE security provider to support DTLS Version 1.0 and DTLS Version 1.2 protocols.
2. (JEP 244) Enables the client and server in a Transport Layer Security (TLS) connection to negotiate the application protocol to be used.
3. (JEP 249) Enables the server in a TLS connection to check for a revoked X.509 certificate revocation.
4. (JEP 246) Improves performance ranging from 34x to 150x for AES/GCM/NoPadding using GHASH HotSpot intrinsics.
5. (JEP 273) Provides the functionality of Deterministic Random Bit Generator (DRBG) mechanisms as specified in NIST SP 800-90Ar1 in the SecureRandom API.
6. (JEP 288) Improves the security configuration of the JDK by providing a more flexible mechanism to disable X.509 certificate chains with SHA-1-based signatures.
7. (JEP 229) Modifies the default keystore type from JKS to PKCS12. PKCS#12 is an extensible, standard, and widely supported format for storing cryptographic keys.
8. (JEP 287) Supports SHA-3 cryptographic hash functions as specified in NIST FIPS 202.
F. New for Deployment in JDK 9
1. Deprecates the Java Plug-in and associated applet technologies in Oracle's JDK 9 builds.
2. Improves the grouping and presentation of options within the Java Control Panel.
3. (JEP 275) Integrates features from Project Jigsaw into the Java Packager, including module awareness and custom runtime creation.
4. (JEP) Deprecates the Applet API, which is becoming less useful as web browser vendors remove support for Java browser plug-ins.
G. New for the Java Language in JDK 9
1. Allow @SafeVargs on private instance methods.
2. Allow effectively final variables to be used as resources in the try-with-resources statement.
3. Allow the diamond with anonymous classes if the argument type of the inferred type is denotable.
4. Add support for private interface methods.
H. New for Javadoc in JDK 9
1. (JEP 221) Replaces the old Doclet API with a new simplified API that leverages other standard, existing APIs.
2. (JEP 224) Supports generating HTML5 output.
3. (JEP 225) Provides a search box to the generated API documentation.
4. (JEP 261) Supports documentation comments in module declarations.
I. New for the JVM in JDK 9
1. (JEP 165) Provides a way to control JVM compilation through compiler directive options.
2. (JEP 197) Divides the code cache into distinct segments, each of which contains compiled code of a particular type, to improve performance and enable future extensions.
3. (JEP 276) Dynamically links high-level object operations at run time, such as read a property, write a property, and invoke a function, to the appropriate target method handles.
J. New for JVM Tuning in JDK 9
1. Enhances the Garbage-First (G1) garbage collector to automatically determine several important memory-reclamation settings.
2. (JEP 158) Introduces a common logging system for all components of the JVM.
3. (JEP 214) Removes garbage collector (GC) combinations that were deprecated in JDK 8.
4. (JEP 248) Makes Garbage-First (G1) the default garbage collector (GC) on 32- and 64-bit server configurations.
5. (JEP 271) Reimplements Garbage Collection (GC) logging using the unified JVM logging framework introduced in JEP 158.
6. (JEP 291) Deprecates the Concurrent Mark Sweep (CMS) garbage collector.
K. New for Nashorn in JDK 9
1. (JEP 236) Enables applications, in particular IDEs and server-side frameworks, to parse and analyze ECMAScript code.
2. (JEP 292) Implements many new features introduced in the 6th edition of ECMA-262, also known as ECMAScript 6, or ES6 for short.
L. New for Client Technologies in JDK 9
1. (JEP 251) Enables a set of images with different resolutions to be encapsulated into a single multiresolution image.
2. (JEP 253) Provides public APIs for JavaFX UI controls and CSS functionality that were previously available only through internal packages but are now inaccessible due to modularization.
3. (JEP 256) Replaces the @beaninfo Javadoc tag with the annotation types JavaBean, BeanProperty, and SwingContainer.
4. (JEP 262) Adds Tag Image File Format (TIFF) reading and writing as standard to the package javax.imageio.
5. (JEP 263) Automatically scales and sizes AWT and Swing components for High Dots Per Inch (HiDPI) displays on Windows and Linux.
6. (JEP 272) Adds additional methods to the class java.awt.Desktop that enable you to interact with the desktop.
7. (JEP 283) Enables Java graphical applications, whether based on JavaFX, Swing, or Abstract Window Toolkit (AWT), to use either the GTK+ version 2 or version 3 on Linux or Solaris.
M. New for Internationalization in JDK 9
1. (JEP 267) Supports Unicode 8.0. JDK 8 supported Unicode 6.2.
2. (JEP 252) Uses the Common Locale Data Repository's (CLDR) XML-based locale data, first added in JDK 8, as the default locale data in JDK 9.
3. (JEP 226) Loads properties files in UTF-8 encoding. In previous releases, ISO-8859-1 encoding was used when loading property resource bundles.