title: How to fix "java.lang.UnsupportedClassVersionError" on kafka-start-server.sh
body: <p>I am trying to install <code>kafka</code> on <code>Cloudera</code> quickstart vm. I have done all the steps. But I am getting the following error, while starting the <code>kafka</code> server:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/kafka/common/utils/KafkaThread : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)</p>
  </blockquote>
  
  <p>I have following environment variables set within my <code>.bashrc</code> file</p>
  
  <pre><code>export PATH="/usr/java/jdk1.8.0_211/bin:$PATH"
  
  export KAFKA_HOME="/opt/kafka/kafka_2.11-2.2.0"
  export PATH="$KAFKA_HOME/bin:$PATH"
  
  export KAFKA_CLASSPATH="$KAFKA_HOME/libs/"
  export KAFKA_CONF_DIR="$KAFKA_HOME/config/"
  </code></pre>
  
  <p>I have tried using both <code>java 7</code> and <code>java 8</code> but the error still persists.</p>
  
  <p>Thanks in advance for your help.</p>