It seams your program has compile time errors hence the class is not compiled while creation of jar and your getting ClassNotFound Exception. check for error in your program and resubmit it.
Regarding troubleshoot / debug: you can configure spark environment in eclipse and run programs directly in eclipse, Add following statement in your program:
Specify Hadoop home Dir:
System.setProperty(“hadoop.home.dir”, “E:\\setups\\hadoop-2.5.0-cdh5.3.2\\hadoop-2.5.0-cdh5.3.2\\”)
second argument is the path of Hadoop directory on local filesystem
Set Master to local:
val conf = new SparkConf().setAppName(“WordCount”).setMaster(“local”)
val sc = new SparkContext(conf)
While creation of RDD specify path of localFS:
val data = sc.textFile(“E:\\test\\Posts1.xml”)
Print the final result:
result.foreach { println }