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

Is there a plan to support higher versions of JDK, such as JDK 17? #1070

Open
TaXueWWL opened this issue Feb 4, 2024 · 7 comments
Open

Is there a plan to support higher versions of JDK, such as JDK 17? #1070

TaXueWWL opened this issue Feb 4, 2024 · 7 comments

Comments

@TaXueWWL
Copy link

TaXueWWL commented Feb 4, 2024

Your question

Is there a plan to support higher versions of JDK, such as JDK 17?

Your scenes

we have already upgrade to jdk17

Your advice

when compile with jdk17, occur error:
...\sofa-jraft\jraft-core\src\main\java\com\alipay\sofa\jraft\util\internal\UnsafeIntegerFieldUpdater.java:20:16
java: 程序包sun.misc不存在

Environment

  • SOFAJRaft version:
  • JVM version (e.g. java -version): jdk17
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@fengjiachun
Copy link
Contributor

It's a good suggestion, I will try to support JDK17 in the next version, but I don't know how much work it will involve yet. The next version may not be released quickly, maybe in 2 months. Of course, if you are interested in sending a PR for this, you are very welcome to do so.

@TaXueWWL
Copy link
Author

TaXueWWL commented Feb 4, 2024

I found a temporary way to solve the compile problem.
Add: --add-modules=jdk.unsupported when compile
and Add:
--add-modules=jdk.unsupported
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
when run the app.

@zxuanhong
Copy link
Contributor

zxuanhong commented Mar 7, 2024

@TaXueWWL @fengjiachun 我试着用jdk17,发现会导致rpc提示(注意是:CliService操作集群时,但是启动正常):Connection is null when do check!。实际不是网络问题,我降低到1.8就正常了。我感觉还是有很大问题

@fengjiachun
Copy link
Contributor

@TaXueWWL @fengjiachun 我试着用jdk17,发现会导致rpc提示(注意是:CliService操作集群时,但是启动正常):Connection is null when do check!。实际不是网络问题,我降低到1.8就正常了。我感觉还是有很大问题

For more detail: #1083

@syhily
Copy link

syhily commented May 28, 2024

After testing the sofa-jraft locally, I met some issues in using JDK 17, such as the sun.misc issue. Given that sofa-jraft didn't fully support the JDK 17, I don't know why we close this issue without any clarification.

@fengjiachun
Copy link
Contributor

After testing the sofa-jraft locally, I met some issues in using JDK 17, such as the sun.misc issue. Given that sofa-jraft didn't fully support the JDK 17, I don't know why we close this issue without any clarification.

Sorry, I made a mistake. I thought the author of #1083 had already found a solution. I will reopen this issue.

@fengjiachun fengjiachun reopened this May 29, 2024
@syhily
Copy link

syhily commented May 29, 2024

Thanks for reopening this issue. The main issue in using sofa-jraft with higher JDK is that the difference of OpenJDK and Oracle JDK and the Unsafe has been move to jdk.internal.misc module. This may require the code refactoring in dropping the Unsafe usage. I may try to find a better solution on this.

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

No branches or pull requests

4 participants