Wednesday, January 25, 2023

What's new in JDK 11(my short version)

Link to the Oracle release notes: Oracle Release Notes
Java SE 11 Final Release Specification

Java API Diff page useful for identification of additions, removals or modifications to the Java API, like adding new methods to String class (isBlank, lines, strip, stripLeading, stripTrailing, repeat)

New Features and Enhancements


- added support for Unicode 9 and 10
- java.net.http: standardized the HttpClient that implements HTTP/2 and WebSocket and which replaces HttpURLConnection API.
- java.util.collections: A new default method toArray(IntFunction) has been added to the java.util.Collection interface.
- java.util:i18n: Updated Locale Data to Unicode CLDR v33
- compiler: Lazy Allocation of Compiler Threads, to prevent initial large amount of compiler threads on multi-cpu machines. -XX:+UseDynamicNumberOfCompilerThreads
- hotspot/gc: The experimental Z concurrent garbage collector:
    1. Pause times do not exceed 10 ms.
    2. Pause times do not increase with the heap or live-set size.
    3. Handle heaps ranging from a few hundred megabytes to multi terabytes in size
For the limitations of this GC, refer to the Release Notes.
- hotspot/gc: Epsilon No-Op Garbage Collector: only allocation, no reclamation. Useful for performance testing.
- security-libs/javax.net.ssl: JEP 332 Transport Layer Security (TLS) 1.3 RFC 8446
- tools/javac: JEP 323: Local-Variable Syntax for Lambda Parameters -> usage of var in declaring the formal parameters of lambda expression.
Imposes restriction on using var for all other formal parameters of a lambda expression.
- tools/launcher: JEP 330 Launch Single-File Source-Code Programs -> Java launcher to run a program supplied as a single file of Java source code.

- hotspot/jvmti: Provide a low-overhead way of sampling Java heap allocations, accessible via JVMTI:
    1. low overhead
    2. sampling all allocations
    3. can be GC algorithm or VM implementation agnostic.
    4. info about live and dead Java objects.
- hotspot/runtime: Nest-Based Access Control -> arrangement of classes and interfaces in nests. Low level change.
Allows classes and interfaces which are logically related to same code, but compiled to distinct class files to access private members without bridge methods.
- security-libs: JEP 324 Key Agreement with Curve25519 and Curve448
- security-libs/javax.crypto: Added Brainpool EC Support (RFC 5639)
- security-libs/javax.crypto: JEP 329 ChaCha20 and Poly1305 Cryptographic Algorithms
- security-libs/javax.crypto: Enhanced KeyStore Mechanisms
- security-libs/javax.crypto: RSASSA-PSS Signature Support Added to SunMSCAPI
- security-libs/org.ietf.jgss:krb5: Support for AES Encryption with HMAC-SHA2 for Kerberos 5 Defined in RFC 8009


Removed Features and Options


- client-libs: Removal of com.sun.awt.AWTUtilities Class, deprecated in JDK 10
- client-libs/2d: Removal of Lucida Fonts from Oracle JDK. JDK does not provide anymore any fonts and relies only on OS fonts. Apps will fail.
- client-libs/java.awt: Removal of appletviewer Launcher deprecated in JDK 9
- client-libs/javax.imageio: Oracle JDK's javax.imageio JPEG Plugin No Longer Supports Images with alpha. Apps will fail.
- core-libs/java.lang: Removal of Thread.destroy() and Thread.stop(Throwable) methods. Thread.destroy was never implemented, and stop has been non-functional since Java SE 8.
- core-svc/javax.management: Removal of JVM-MANAGEMENT-MIB.mib -> Now instead of the specification for JVM monitoring and management through SNMP. Customers can use JMX to monitor and manage a running JVM and to access the standard set of metrics and operations.
- deploy: Removal of Java Deployment Technologies -> The Java Plugin and Java WebStart technologies that were deprecated in JDK 9 and marked as candidates for removal in JDK 10, have now been removed
- infrastructure: Removal of Java Mission Control from the Oracle JDK, available separately.
- javafx/other: Removal of JavaFX from the Oracle JDK, available separately, as OpenJFX

- core-libs: Removal of sun.misc.Unsafe.defineClass. Now must use: java.lang.invoke.MethodHandles.Lookup.defineClass
- core-libs/java.nio: Removal of sun.nio.ch.disableSystemWideOverlappingFileLockCheck Property, introduced in JDK for supressing JVM-wide file locking.
- core-libs/java.util:i18n: Removal of sun.locale.formatasdefault Property introduced in JDK7.
- core-svc/tools: Removal of SNMP Agent jdk.snmp.
- other-libs: JEP 320 Remove the Java EE and CORBA Modules:
    1. java.xml.ws
    2. java.xml.bind
    3. java.activation
    4. java.xml.ws.annotation
    5. java.corba
    6. java.transaction
    7. java.se.ee
    8. jdk.xml.ws
    9. jdk.xml.bind
    + other changes.


Deprecated Features and Options, Other Notes and Differences between Oracle JDK and OpenJDK not included.