open kafka-run-class.sh with sudo to write
you can find kafka-run-class.sh in your kafka folder : kafka/bin/kafka-run-class.sh
check for these lines

Modify the JAVA variable in the else part to point to the java executable in your java/bin. like JAVA="$JAVA_HOME/java"