0

I have Compiled Java program and attempted to run using spark but it is showing ClassNotFound Exception even if class file exists there.enter image description here

    package org.apache.spark.examples;

    import org.apache.spark.SparkConf;
    import org.apache.spark.api.java.JavaRDD;
    import org.apache.spark.api.java.JavaSparkContext;
    import org.apache.spark.api.java.function;  

    public final class JavaHelloWorld
    {
         public static void main(String args[])throws Exception
         {

         SparkConf sparkConf = new SparkConf().setAppName("JavaSparkPi");
         JavaSparkContext jsc = new JavaSparkContext(sparkConf);
         System.out.println("Hello World... Niyat From Apache Spark");
         }
    }   
1
  • 1
    It would be better if you post your code and stack trace in text instead of image. Commented Aug 4, 2015 at 6:36

1 Answer 1

2

You have to write the exact name of the class, you have the initial j lowercase:

JavaHelloWorld

Sign up to request clarification or add additional context in comments.

2 Comments

Is the class inside the spark-examples-1.1.10-hadoop1.0.4.jar? Because it is not being found.
Yes. It is inside the spark-examples-1.1.10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.