0

Trying to setup Kafka on Ubuntu 18.04. Used the kafka_2.11-2.1.1.tgz. Have jdk8, JAVA_HOME etc all fine.

$JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
java -version
openjdk version "1.8.0_232"

Set and started Kafka systemd[1]: Started kafka.service.
When I issue my first test command
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic TutorialTopic
/home/kafka/kafka/bin/kafka-run-class.sh: line 306: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin/java: Not a directory

As you can notice I have this extra/duplicate /bin/java in the java executable path in the end. Where is this coming from I don't know?

Sam-T
  • 1,877
  • 6
  • 23
  • 51

1 Answers1

2

Your $JAVA_HOME seems to be incorrect.

Checkout setting $JAVA_HOME environment variable.

Rahul Goel
  • 842
  • 1
  • 8
  • 14
  • changed JAVA_HOME - it but still same error. For Kafka do we also have to setup JRE_HOME – Sam-T Jan 28 '20 at 05:47
  • I think JAVA_HOME needs to be `/usr/lib/jvm/java-8-openjdk-amd64` - This finally worked – Sam-T Jan 28 '20 at 05:53