java17的有用更新
G1GC优化,性能优化+内存归还给系统
文本块
stream 的toList语法糖

下载java17

  • Amazon Corretto 17
wget https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.deb
sudo dpkg -i amazon-corretto-17-x64-linux-jdk.deb
java -version
#openjdk version "17.0.9" 2023-10-17 LTS
#OpenJDK Runtime Environment Corretto-17.0.9.8.1 (build 17.0.9+8-LTS)
#OpenJDK 64-Bit Server VM Corretto-17.0.9.8.1 (build 17.0.9+8-LTS, mixed mode, sharing)

调整jar启动参数

  • 用于
--add-opens java.base/java.util=ALL-UNNAMED

运行

  • 测试java17加上面参数后可以无无缝跑之前java11打的包