Java 21 / JDK 21 已正式 GA,此版本是继 JDK 17 后的长期支持版本 (LTS),Oracle 将为其提供至少八年的技术支持和更新。
正式稳定功能
- JEP 444:虚拟线程
- JEP 431:序列集合
- JEP 440:记录模式
- JEP 441:switch 模式匹配
- JEP 439:分代 ZGC
- JEP 449:弃用 Windows 32 位 x86 移植
- JEP 451:准备禁止动态加载代理
- JEP 452:密钥封装机制 API
预览阶段功能
-
JEP 442:外部函数和内存 API(第三次预览)
-
JEP 446:作用域值(预览)
-
JEP 453:结构化并发(预览)
-
JEP 430:字符串模板(预览)
-
JEP 443:未命名模式和变量(预览)
-
JEP 445:未命名类和实例主方法(预览)
孵化阶段功能
- JEP 448:Vector API(孵化器第六阶段)
Download: https://jdk.java.net/21/
Release notes: https://jdk.java.net/21/release-notes
Features: https://openjdk.org/projects/jdk/21/
In JDK 18 and later, UTF-8 is the default charset used by Java SE APIs on all operating systems. See JEP 400: UTF-8 by Default. In contrast, in JDK 17 and earlier releases, the default charset is determined when the Java runtime starts, that is, on macOS, the default charset used to be UTF-8 except in the POSIX C locale. On other operating systems, it used to depend on the user's locale and the default encoding.
```java
@SolonMain
public class App {
public static void main(String[] args) {
Solon.start(App.class, args, app->{
app.onEvent(HttpServerConfigure.class, e->{
e.setExecutor(Executors.newVirtualThreadPerTaskExecutor());
});
});
}
}
```
https://www.graalvm.org/latest/reference-manual/python/standalone-binaries/
https://github.com/oracle/graalpython/releases/tag/graal-23.1.0
https://github.com/oracle/graal/issues/6855
https://jdk.java.net/21/
oracle jdk 21
https://www.oracle.com/java/technologies/downloads/#jdk21-windows
graalvm-community-jdk-21.0.0_windows-x64_bin.zip
https://github.com/graalvm/graalvm-ce-builds/releases
graalvm-jdk-21_windows-x64_bin.zip
https://www.oracle.com/java/technologies/downloads/#graalvmjava21