JDK 25

Search documents
“我用 Java 8”已成过去式!Java 25正式发布:甲骨文提供八年更新、18项新功能上线
程序员的那些事· 2025-09-25 10:09
Core Viewpoint - Oracle has released Java 25, the latest Long-Term Support (LTS) version, which will receive at least 8 years of commercial support, with free updates until September 2028, followed by continued updates under a stricter licensing agreement until at least September 2033 [1][2]. Feature Updates - Java 25 introduces 18 new features, including 5 that Oracle claims will assist in AI development [4]. - Language improvements include enhanced type matching, simplified module imports, and a more intuitive main method instantiation [6]. - The structured concurrency feature is in its fifth preview, allowing management of related concurrent tasks as a whole [7]. - Scope values and stable values are finalized, enabling lightweight sharing of immutable data across threads [8]. - The Vector API has been improved to utilize CPU vector instructions for more efficient calculations [9]. Security and Performance Enhancements - New APIs for PEM encoding and key derivation functions have been introduced, enhancing security capabilities [10]. - Compact Object Headers reduce memory usage by compressing object headers from 96/128 bits to 64 bits [11]. - JDK Flight Recorder (JFR) has been enhanced with CPU time analysis and method execution tracking features, improving performance monitoring [12][13]. - The Generational Shenandoah garbage collector has been promoted to a formal feature, improving memory utilization under high load [14]. Market Context - Despite the release of Java 25, Java 17 remains the most widely used version, with Java 21 following closely behind, indicating a cautious adoption of newer versions by developers [15].