This article aims to describe Java 25 and some of its new features.
Java 25 Windows download link: https://www.oracle.com/java/technologies/downloads/#jdk25-windows
Java 25 documentation download link: https://www.oracle.com/java/technologies/javase-jdk25-doc-downloads.html
Introduction
On September 16th, following Java 21, another TLS version, Java 25, was released, bringing with it a large number of new features. Below is a brief description of some of the new features in Java 25.
Java 25 Finalized Features
core-libs
- New method: CharSequence.getChars(int, int, char[], int)
- New system property: stdin.encoding
- HttpClient: BodyHandlers.limiting / BodySubscribers.limiting
- HttpResponse.connectionLabel()
- ZIP File System support for accessMode=readOnly
- Inflater and Deflater implement AutoCloseable
- ForkJoinPool implements ScheduledExecutorService + new submitWithTimeout
- CompletableFuture/SubmissionPublisher uses commonPool asynchronously by default
JVM/HotSpot
- G1 GC shares G1CardSet to reduce remembered set overhead
- -XX:+UseCompactObjectHeaders becomes a finalized product option
- HotSpotDiagnosticMXBean.dumpThreads / jcmd Thread.dump_to_file supports lock information + JSON schema
JFR
- New @Contextual annotation
Security Libraries
- java.security.debug outputs thread/timestamp/call location by default
- SUN provider adds SHAKE128-256 / SHAKE256-512
- SunPKCS11 adds HKDF-SHA256/384/512
- jdk.tls.disabledAlgorithms supports disabling algorithms by TLS usage scenario
- TLS Keying Material Exporters (JSSE + SunJSSE)
- XML Security Library upgraded to Santuario 3.0.5, supports four SHA3-ECDSA algorithms
- jar –validate validation enhancements (duplicate entries, invalid paths, LOC/CEN inconsistencies, etc.)
Java 25 Preview/Incubator Features
- JEP 502: Stable Values (Preview)
- JEP 505: Structured Concurrency (Fifth Preview)
- JEP 506: Scoped Values (Finalized? → Needs confirmation: Standardized in Java 25, was preview in Java 24)
- JEP 507: Primitive Types in Patterns, instanceof, and switch (Third Preview)
- JEP 508: Vector API (Tenth Incubation)
Java 25 Removed Features
core-libs / java.net
1
2
3
4
5
| java.net.Socket constructors
Two constructors accepting stream=false are deprecated; calling them will throw IllegalArgumentException
No longer allows creating DatagramSocket through them
Alternative: Use java.net.DatagramSocket
Will be completely removed in a future version
|
core-svc / javax.management
1
2
3
4
5
6
7
8
9
| Removal of legacy JMX system properties
Deleted the following historical compatibility properties:
jmx.extend.open.types
jmx.invoke.getters
jdk.jmx.mbeans.allowNonPublic
jmx.mxbean.multiname
jmx.tabular.data.hash.map
jmx.remote.x.buffer.size (correct name is jmx.remote.x.notification.buffer.size)
These properties were originally only for transition and are now invalid
|
hotspot / runtime
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| PerfData sampling feature removed
Removed StatSampler
Removed parameter -XX:PerfDataSamplingInterval
Removed counter: sun.os.hrt.ticks (can use sun.rt.createVmBeginTime instead)
GC PerfData behavior change: Eden usage count is always 0
Alternative: Use Java Flight Recorder (JFR) or JMX
Legacy monitor performance counters sun.rt._sync*
Removed the following counters:
_sync_ContendedLockAttempts
_sync_FutileWakeups
_sync_Parks
_sync_Notifications
_sync_Inflations
_sync_Deflations
_sync_MonExtant
Alternative: Use corresponding JFR events:
JavaMonitorEnter
JavaMonitorWait
JavaMonitorNotify
JavaMonitorInflate / JavaMonitorDeflate
JavaMonitorStatistics
|
security-libs / java.security
1
2
3
4
5
6
| Removal of expired root certificates
Baltimore CyberTrust Root
alias: "baltimorecybertrustca [jdk]"
Camerfirma root certificates:
"camerfirmachamberscommerceca [jdk]"
"camerfirmachambersignca [jdk]"
|
security-libs / javax.crypto:pkcs11
1
2
3
4
5
6
7
8
| Removal of SunPKCS11 Provider's PBE SecretKeyFactory implementation
Deleted the following algorithms:
SecretKeyFactory.PBEWithHmac[MD]AndAES_128
SecretKeyFactory.PBEWithHmac[MD]AndAES_256
SecretKeyFactory.HmacPBE[MD]
[MD] includes: SHA1 / SHA224 / SHA256 / SHA384 / SHA512
Reason for removal: Inconsistent with SunJCE implementation, may cause interoperability issues
Alternative: Use the corresponding SunJCE implementation
|
Other
1
| Official announcement and OpenJDK release notes state Java 25 formally "drops 32-bit support for x86". It no longer supports x86 32-bit platforms.
|
Mind Map
