title: How to run Apache spark Java program in standalone
body: <p>I have written a java program for spark, but I am not able to run it from the command line.</p>
  
  <p>I have followed the steps given in the Quick start guide, but I am getting the following error. Please help me out with this problem.</p>
  
  <p>Here is the error :</p>
  
  <pre><code>hadoopnod@hadoopnod:~/spark-1.2.1/bin$ ./run-example "SimpleApp " --master local /home/hadoopnod/Spark_Java/target/simple-project-1.0.jarjava.lang.ClassNotFoundException: org.apache.spark.examples.SimpleApp
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:342)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:75)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
  </code></pre>