i have downloaded kafka from here https://www.apache.org/dyn/closer.cgi?path=/kafka/3.4.0/kafka_2.13-3.4.0.tgz
Zookeeper starts with the command
bin/zookeeper-server-start.sh config/zookeeper.properties
but when i ran this command
bin/kafka-server-start.sh config/server.properties
i got this
[2023-03-12 14:25:29,772] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Ljava/lang/Object;
at kafka.Kafka$.getPropsFromArgs(Kafka.scala:43) ~[kafka_2.13-3.4.0.jar:?]
at kafka.Kafka$.main(Kafka.scala:92) [kafka_2.13-3.4.0.jar:?]
at kafka.Kafka.main(Kafka.scala) [kafka_2.13-3.4.0.jar:?]
Exception in thread "main" java.lang.NoSuchMethodError: scala.Option.orNull(Lscala/$less$colon$less;)Ljava/lang/Object;
at kafka.utils.Exit$.exit(Exit.scala:28)
at kafka.Kafka$.main(Kafka.scala:128)
at kafka.Kafka.main(Kafka.scala)
I tried to check if it has scala lib in libs and orNull method exists in in that scala version
java.class.path
. There should be lineINFO Server environment:java.class.path=...
in the output ofzookeeper-server-start.sh
andINFO Client environment:java.class.path=...
in the output ofkafka-server-start.sh
. It's better to show the whole output of the both commands. Maybe something confuses scala 2.13 and 2.12. – MunizrefArrayOps
is different in 2.12def refArrayOps(scala.Array[scala.Any]): scala.Array[scala.Any]
(scalap)public <T> T[] refArrayOps(T[])
(javap) api and 2.13def refArrayOps(scala.Array[scala.Any]): scala.Any
(scalap)public <T> T[] refArrayOps(T[])
(javap) api – Munizzookeeper-server-start.sh
andkafka-server-start.sh
fromkafka_2.13-3.4.0
run. Doesn't Kafka usescala-library
fromkafka_2.13-3.4.0/libs
and not installed in the system? At least at the site it's written that Java 8+ should be installed, not Scala. But maybe this can be different at MacOS. – Munizkafka_2.13-3.4.0
doesn't match but runs (because uses Kafka local Scala library and not the one that is installed). In my output ofkafka-server-start.sh
,java.class.path
haslibs/scala-library-2.13.10.jar
and not Scala 2.12 from my system$PATH
. But maybe something is different in OP's setting. – Muniz