@@ -59,7 +59,7 @@ object CommandUtils extends Logging {
5959 private def buildCommandSeq (command : Command , memory : Int , sparkHome : String ): Seq [String ] = {
6060 // SPARK-698: do not call the run.cmd script, as process.destroy()
6161 // fails to kill a process tree on Windows
62- val cmd = new CommandLauncher (sparkHome, memory, command.environment ).buildCommand()
62+ val cmd = new CommandLauncher (sparkHome, memory, command).buildCommand()
6363 cmd.toSeq ++ Seq (command.mainClass) ++ command.arguments
6464 }
6565
@@ -111,15 +111,16 @@ object CommandUtils extends Logging {
111111 }
112112}
113113
114- private class CommandLauncher (sparkHome : String , memoryMb : Int , env : Map [ String , String ] )
115- extends AbstractLauncher [CommandLauncher ](env ) {
114+ private class CommandLauncher (sparkHome : String , memoryMb : Int , command : Command )
115+ extends AbstractLauncher [CommandLauncher ](command.environment ) {
116116
117117 setSparkHome(sparkHome)
118118
119119 def buildCommand (): JList [String ] = {
120- val cmd = buildJavaCommand(null )
120+ val cmd = buildJavaCommand(command.classPathEntries.mkString( File .pathSeparator) )
121121 cmd.add(s " -Xms ${memoryMb}M " )
122122 cmd.add(s " -Xmx ${memoryMb}M " )
123+ command.javaOpts.foreach { cmd.add }
123124 addOptionString(cmd, getenv(" SPARK_JAVA_OPTS" ))
124125 cmd
125126 }
0 commit comments