开发和运行环境服务升级 1. 安装JDK17 点击打开JDK17下载页面 根据本地开发系统环境选择合适的安装包进行下载并使用 注意事项: 安装jdk17 JAVA_HOME/PATH 环境变量配置 2. RocketMQ 升级 推荐升级至 4.8.x 版本 点击下载4.8.0版本 注:若 RocketMQ 版本低于 4.8.x 版本,需进行升级,否则无法正常运行在 JDK17 环境中。 支持程度 RocketMQ 版本 关键说明 基础运行兼容 4.8.0+ 首次适配 JDK 9+ 核心运行环境,修复模块导出、反射限制等基础问题 完整特性兼容 4.9.0+ 解决 JDK 9+ 下的网络、线程、日志等细节兼容问题,生产环境可落地 官方明确标注支持 5.0.0+(5.x 全系列) 官网文档明确声明支持 JDK 8/11/17(9/10 属于过渡版本,间接兼容) 对于无法升级 RocketMQ 版本的环境,可通过修改 runserver.sh 和 runbroker.sh 运行脚本进行适配。在使用 cmd 脚本的运行环境中,可通过修改 runserver.cmd 和 runbroker.cmd 运行脚本进行适配。 下面提供了基于 4.5.2 版本修改后的 runserver.sh 和 runbroker.sh 脚本进行参考。修改运行脚本仅适用于无法升级中间件版本的特殊环境,下面提供的修改后的脚本,只能保证收发消息功能正常,无法保证其他功能的正常使用。 核心变更内容: JAVA_OPT 配置使用 –add-opens 参数以支持非模块化内置包在运行代码中的使用。 移除 JDK17 不再支持的其他 JVM 参数。 runserver.sh #!/bin/sh # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR…