6

It would be really appreciated if anyone can help sort it out the following path issue for me? I highly doubt this is related to missing path setting but don't know how can I fix it.

rxie@ubuntu:~/Downloads/spark$ echo $PATH
/usr/bin/java:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rxie/Downloads/s                                                                                  park:/home/rxie/Downloads/spark/bin:/usr/bin/java
rxie@ubuntu:~/Downloads/spark$ pyspark

Error: Could not find or load main class org.apache.spark.launcher.Main

rxie@ubuntu:~/Downloads/spark$ spark-shell

Error: Could not find or load main class org.apache.spark.launcher.Main

rxie@ubuntu:~/Downloads/spark$ pwd /home/rxie/Downloads/spark

rxie@ubuntu:~/Downloads/spark$ ls
bin  conf  data  examples  jars  kubernetes  licenses  R  yarn

Updated with the PATH:

rxie@ubuntu:~$ echo $PATH
/home/rxie/Downloads/spark:/usr/bin/java:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
Ramesh Maharjan
  • 41,071
  • 6
  • 69
  • 97
Choix
  • 555
  • 1
  • 12
  • 28
  • No, this is not duplicate, I followed the steps there and still receive the error and spark-shell cannot be started. – Choix Jun 17 '18 at 14:41
  • 1
    You have to include the bin directory also in `/home/rxie/Downloads/spark` so echo $PATH should return you `/home/rxie/Downloads/spark/bin:/usr/bin/java:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin` – Ramesh Maharjan Jun 17 '18 at 14:47

1 Answers1

2

Try setting SPARK_HOME environment variable to ~/Downloads/spark

Devstr
  • 4,431
  • 1
  • 18
  • 30