I found a solution to resolve your problem:
props file : (mypropsfile.conf) // note: prefix your key with "spark." else props will be ignored.
spark.myapp.input /input/path
spark.myapp.output /output/path
launch
$SPARK_HOME/bin/spark-submit --properties-file mypropsfile.conf
how to call in code :( inside code)... (More)