I got a very similar issue when working with kafka_2.12-2.2.0 Neither my Zookeeper client nor any of my Kafka brokers were able to connect to the Zookeeper server. (issue relating to some internal authentication)
I was using JDK 23 by default set by my Mac. So, instead of rolling back to JDK 11, I used the latest Kafka version available on their website https://kafka.apache.org/quickstart It now works perfectly with the latest JDK and the latest Kafka version.