How to specify which java version to use in spark-submit command?

后端 未结 5 1596
走了就别回头了
走了就别回头了 2021-02-13 11:27

I want to run a spark streaming application on a yarn cluster on a remote server. The default java version is 1.7 but i want to use 1.8 for my application which is also there in

5条回答
  •  名媛妹妹
    2021-02-13 11:59

    Although you can force the Driver code to run on a particular Java version (export JAVA_HOME=/path/to/jre/ && spark-submit ... ), the workers will execute the code with the default Java version from the yarn user's PATH from the worker machine.

    What you can do is set each Spark instance to use a particular JAVA_HOME by editing the spark-env.sh files (documentation).

提交回复
热议问题