-
Notifications
You must be signed in to change notification settings - Fork 309
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
Can not work well with JDK 9+ #5
Labels
enhancement
enhancement
Comments
this is my runbroker.sh .
|
use this. you can run on jdk-17 zgc . |
Notice: you should increase them. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Java 9 introduces overridden methods with covariant return types for the following methods in java.nio.ByteBuffer:
In Java 9 they all now return ByteBuffer, whereas the methods they override return Buffer,
resulting in exceptions like this when executing on Java 8 and lower:
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer
This is because the generated byte code includes the static return type of the method, which is not found on Java 8 and lower because the overloaded methods with covariant return types don't exist (the issue appears even with source and target 8 or lower in compilation parameters).
The workaroud solution is to cast ByteBuffer instances to Buffer before calling the method. So, If we want to support JDK 11, we need to polish here and keep be compatible.
The text was updated successfully, but these errors were encountered: