Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NameServer启动失败] JDK17启动NameServer时失败 #7495

Closed
3 tasks done
PottermoreIron opened this issue Oct 24, 2023 · 3 comments · Fixed by #7507
Closed
3 tasks done

[NameServer启动失败] JDK17启动NameServer时失败 #7495

PottermoreIron opened this issue Oct 24, 2023 · 3 comments · Fixed by #7507
Labels

Comments

@PottermoreIron
Copy link

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

Windows 10
JDK17

RocketMQ version

5.1.4

JDK Version

Oracle JDK17

Describe the Bug

在bin目录下启动mqnamesrv.cmd时报错:
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Steps to Reproduce

在RocketMQ安装目录下启动mqnamesrv.cmd报错

What Did You Expect to See?

NameServer启动成功,终端输出:The Name Server boot success. serializeType=JSON, address 0.0.0.0:9876

What Did You See Instead?

Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit

Additional Context

应该是JDK版本的问题,查询了网上的资料,发现由于GC相关机制的改变,RocketMQ脚本的配置没有配合JDK高版本。我找到了一篇博客http://www.fastrabbit.cn/articles/42.
根据博客修改了cmd,最后NameServer启动成功。但还是希望RocketMQ能支持JDK高版本,毕竟没法保证每个项目都使用JDK8

@francisoliverlee
Copy link
Member

linux平台的启动脚本已经适配了不同的jdk使用不同的JAVA_OPT, 主要代码体现:
https://github.com/apache/rocketmq/blob/develop/distribution/bin/runserver.sh#L83-L98

windows平台的启动脚本:https://github.com/apache/rocketmq/blob/develop/distribution/bin/runserver.cmd#L30 没有区分, 导致一些jdk启动失败。

可以尝试根据linux平台启动脚本, 修改下windows平台的启动脚本, 欢迎提交PR

@joeCarf
Copy link
Contributor

joeCarf commented Oct 26, 2023

linux平台的启动脚本已经适配了不同的jdk使用不同的JAVA_OPT, 主要代码体现: https://github.com/apache/rocketmq/blob/develop/distribution/bin/runserver.sh#L83-L98

windows平台的启动脚本:https://github.com/apache/rocketmq/blob/develop/distribution/bin/runserver.cmd#L30 没有区分, 导致一些jdk启动失败。

可以尝试根据linux平台启动脚本, 修改下windows平台的启动脚本, 欢迎提交PR

I would like to submit a pr

@joeCarf
Copy link
Contributor

joeCarf commented Oct 26, 2023

#7507 Hi, plz help review this pr. Because I'm poor in Windows cmd files, and do not have env to test it, it may have bugs @francisoliverlee @PottermoreIron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants