[
https://issues.apache.org/jira/browse/ZOOKEEPER-3215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17093547#comment-17093547
]
Sean Busbey commented on ZOOKEEPER-3215:
----------------------------------------
Now that I've gotten zookeeper 3.5.7 to build from source I get the same issue.
I also worked out that the from source build is using an openjdk also from
homebrew, which is totally different then all the other JDKs I have installed
because it's keg-only (which means that by default it gets used within homebrew
but not outside of it).
{code}
busbey-mba13:~ busbey$ /usr/local/opt/openjdk/bin/javac -version
javac 13.0.2
{code}
I would assume the bottle for zookeeper is made with this same jdk version,
which explains why I hit the issue. The oldest homebrew openjdk version I can
find is JDK11, which essentially means folks trying to use a homebrew installed
Zookeeper client will need to use JDK9+ until this issue is addressed.
> Handle Java 9/11 additions of covariant return types to java.nio.ByteBuffer
> methods
> -----------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-3215
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3215
> Project: ZooKeeper
> Issue Type: Bug
> Affects Versions: 3.4.13
> Reporter: V
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 2h
> Remaining Estimate: 0h
>
> Java 9 introduces covariant return types which allows one to have different
> return types if return type in the overridden method is a sub type. Since
> Java 9, few functions return ByteBuffer, whereas the parent method return
> Buffer, resulting in causing issues for Java 8 and below since for them the
> method does not exist.
> Steps To Reproduce:
> 1. Setup ZooKeeper Server with JDK11.
> 2. Setup ZooKeeper Client with JDK8.
> 3. Try connecting the client and server.
> Results:
> Cast ByteBuffer instances to Buffer before calling the method.
>
> Notes:
> There was a similar bug in the MongoDB community -
> [https://jira.mongodb.org/browse/JAVA-2559]
>
> This is not a contribution.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)