Choose your Java version

(Saagie v0.9 Astérix)

spark-submit defaults to Java 1.7

If your job jar was compiled with Java 1.8, you should change the JAVA_HOME environment variable accordingly:

replace the default command:

spark-submit {driver_options} --class=MyClass {file} arg1 arg2

with:

;
export JAVA_HOME=/usr/lib/jvm/java-8-oracle;
/opt/spark/1.6/bin/spark-submit {driver_options} --class=MyClass {file} arg1 arg2;

 

Note that JAVA_HOME is only set for the duration of the job execution. It will not affect other jobs.