title: spark-class: line 71...No such file or directory
body: <p>I've installed Spark 2.1.1 on Ubuntu and no matter what I do, it doesn't seem to agree with the java path. When I run "spark-submit --version" or "spark-shell" I get the following error:</p>
  
  <p><strong>/usr/local/spark/bin/spark-class: line 71: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin//bin/java: No such file or directory</strong></p>
  
  <p>Now obviously the "/bin//bin/java" is problematic, but I'm not sure where to change the configuration. The spark-class file has the following lines:</p>
  
  <pre><code>if [ -n "${JAVA_HOME}" ]; then
    RUNNER="${JAVA_HOME}/bin/java"
  </code></pre>
  
  <p>I was originally using a version of Spark meant for Hadoop 2.4 and when I changed it to "RUNNER="${JAVA_HOME}" it would either give me the error "[path] is a directory" or "[path] is not a directory." This was after also trying multiple path permutations in /etc/environment</p>
  
  <p>What I now have in /etc/environment is:</p>
  
  <p><strong>JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/"</strong></p>
  
  <p>This is the current java setup that I have:</p>
  
  <p>r<strong>oot@ubuntu:~# update-alternatives --config java
  There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java</strong></p>
  
  <p>bashrc has the following:</p>
  
  <pre><code>export SPARK_HOME="/usr/local/spark"
  export PATH="$PATH:$SPARK_HOME/bin"
  </code></pre>
  
  <p>Can anyone advise: 1) What files I need to change and 2) how I need to change them? Thanks in advance.</p>
  
  <p>spark-class file is in the link, just in case:</p>
  
  <p><a href="http://vaughn-s.net/hadoop/spark-class" rel="noreferrer">http://vaughn-s.net/hadoop/spark-class</a></p>