title: java.lang.NoClassDefFoundError when running read_stream_kafka using sparklyr library in R
body: <p>I am trying to stream data from kafka producer to R for processing using sparklyr but when I run the read_stream_kafka() function i get an error below:</p>
  <p><strong>read_options = list(kafka.bootstrap.server = &quot;localhost:9092&quot;, subscribe = &quot;topic&quot;)</strong></p>
  <p><strong>&gt; stream = stream_read_kafka(sc, options = read_options)</strong></p>
  <p>Error:java.lang.NoClassDefFoundError:org/apache/kafka/common/serialization/ByteArrayDeserializer</p>
  <p><strong>Caused by:</strong> java.lang.ClassNotFoundException:org.apache.kafka.common.serialization.ByteArrayDeserializer</p>
  <p>I am using the Docker platform to contain the KAFKA and zookeeper container.</p>
  <p>I also ensured that i am using java8, and I have already initialised the following paths: SPARK_HOME, SCALA_HOME, and JAVA_HOME as well.</p>
  <p>I also added the rkafka and rjava library since I suspected its probably because I havent included the kafka library but the error is still there.</p>
  <p>Further information that may be useful to help solve this challenge include:
  My kafka version is kafka_2.13_2.8.1, the spark version is spark-2.8.4-bin-hadoop2.7,  the scala version is 2.12, and the R version is 4.1.1. Might the error be resulting from a compatibility issue. If so, then how do i solve this.</p>
  <p>Please assist on this</p>
  <p>Many thanks</p>