[
https://issues.apache.org/jira/browse/ZOOKEEPER-3215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17093555#comment-17093555
]
Sean Busbey commented on ZOOKEEPER-3215:
----------------------------------------
For those willing to risk messing up their homebrew installation, I was able to
work around things with the following high level steps:
* remove the homebrew versions of zookeeper, ant, openjdk
* install the cask version of adoptopenjdk8
* symlink the {{adoptopenjdk-8.jdk/Contents/Home/}} directory into
/usr/local/opt/openjdk
* install ant with the unsupported {{--ignore-dependencies}} flag
* use the info homebrew command to verify all the needed dependencies are
present for zookeeper
* install zookeeper with the flags {{--build-from-source --ignore-dependencies}}
That got me a zookeeper that was compiled with JDK8 (currently build 252) and I
could successfully use the {{zkCli}} from homebrew with JDK8 (specifically the
JDK8 build 161 I previously was trying to use).
Alternatively you can keep JAVA_HOME unset when using {{zkCli}} and make sure
whatever application you want to use with JDK8 has client libraries from
somewhere other than homebrew.
> 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)