I have written a Java program for Spark. But how to run and compile it from Unix command line. Do I have to include any jar while compiling for running
Aditionally to the selected answer, if you want to connect to an external standalone Spark instance:
SparkConf conf =
new SparkConf()
.setAppName("Simple Application")
.setMaster("spark://10.3.50.139:7077");
JavaSparkContext sc = new JavaSparkContext(conf);
Here you can find more "master" configuration depending on where Spark is running: http://spark.apache.org/docs/latest/submitting-applications.html#master-urls