Kafka with Zookeeper 3.5.7 Crash NoSuchMethodError: java.nio.ByteBuffer.flip()

It's explained in other service like hazelcast and dopio that this was caused by backward compatibility issue from jdk 9 to jdk 8.

There are 2 obvious options, either you:

  1. Update your jdk to 9

  2. Downgrade your zookeeper to 3.4.x

I chose to downgrade my zookeeper to 3.4.14 by using:

# force install zookeeper first
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/6d8197bbb5f77e62d51041a3ae552ce2f8ff1344/Formula/zookeeper.rb

# then force install kafka compatible with zookeeper 3.4.14
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/6d8197bbb5f77e62d51041a3ae552ce2f8ff1344/Formula/kafka.rb