You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by subash basnet <ya...@gmail.com> on 2016/08/12 17:49:39 UTC

Unable to run spark examples in eclipse

Hello all,

I am completely new to spark. I downloaded the spark project from github (
https://github.com/apache/spark) and wanted to run the examples. I
successfully ran the maven command:

build/mvn -DskipTests clean package

But I am not able to build the spark-examples_2.11 project. There are
import issues in the java files like below:
Eg: The import org.apache.spark.SparkConf cannot be resolved
The import org.apache.spark.api.java.JavaSparkContext cannot be resolved
and so on displayed in eclipse.

What am I doing wrong to run these examples?


Best Regards,
Subash Basnet

Re: Unable to run spark examples in eclipse

Posted by subash basnet <ya...@gmail.com>.
I have attached image herewith for more clarification. What could be reason
it's showing this import errors. All the dependencies are there when i
checked in the build path of maven, there are no missing dependencies.

​


Regards,
Subash Basnet

On Fri, Aug 12, 2016 at 7:49 PM, subash basnet <ya...@gmail.com> wrote:

> Hello all,
>
> I am completely new to spark. I downloaded the spark project from github (
> https://github.com/apache/spark) and wanted to run the examples. I
> successfully ran the maven command:
>
> build/mvn -DskipTests clean package
>
> But I am not able to build the spark-examples_2.11 project. There are
> import issues in the java files like below:
> Eg: The import org.apache.spark.SparkConf cannot be resolved
> The import org.apache.spark.api.java.JavaSparkContext cannot be resolved
> and so on displayed in eclipse.
>
> What am I doing wrong to run these examples?
>
>
> Best Regards,
> Subash Basnet
>

Re: Unable to run spark examples in eclipse

Posted by Jacek Laskowski <ja...@japila.pl>.
Hi,

I'm an IntelliJ IDEA-only user and can't help you with the issue other than
recommending to switch to IDEA. Things will change right off the bat!


Pozdrawiam,
Jacek Laskowski
----
https://medium.com/@jaceklaskowski/
Mastering Apache Spark 2.0 http://bit.ly/mastering-apache-spark
Follow me at https://twitter.com/jaceklaskowski

On Sat, Aug 13, 2016 at 11:53 AM, subash basnet <ya...@gmail.com> wrote:

> Hello Jacek Laskowski,
>
> I followed the link, installed sbt, scala. I can build the project via
> terminal successfully, but when I import it to eclipse I get the following
> error:
>
> ​And the spark sub-projects have all the import errors as before.
>
> I have maven 3.3.9 in ubuntu, the same as default required maven version,
> so project build fine via terminal.
> My eclipse has 3.3.3 maven version, so I changed in  the spark/pom.xml the
> required maven version from 3.3.9 to 3.3.3:
> *<maven.version>3.3.3</maven.version>*
>
> After the version change, it buids fine in eclipse also. But since there
> are import errors in each java files, I am not able to run them
> individually. How could I solve this issue.
>
> ​
>
> Regards,
> Subash Basnet
>
> On Sat, Aug 13, 2016 at 3:48 AM, Jacek Laskowski <ja...@japila.pl> wrote:
>
>> Hi,
>>
>> You need to add spark-* libs to the project (using the
>> Eclipse-specific way). The best bet would be to use maven as the main
>> project management tool and import the project then.
>>
>> Seen https://cwiki.apache.org/confluence/display/SPARK/Useful+
>> Developer+Tools#UsefulDeveloperTools-Eclipse
>> ?
>>
>> Pozdrawiam,
>> Jacek Laskowski
>> ----
>> https://medium.com/@jaceklaskowski/
>> Mastering Apache Spark 2.0 http://bit.ly/mastering-apache-spark
>> Follow me at https://twitter.com/jaceklaskowski
>>
>>
>> On Fri, Aug 12, 2016 at 10:49 AM, subash basnet <ya...@gmail.com>
>> wrote:
>> > Hello all,
>> >
>> > I am completely new to spark. I downloaded the spark project from github
>> > (https://github.com/apache/spark) and wanted to run the examples. I
>> > successfully ran the maven command:
>> >
>> > build/mvn -DskipTests clean package
>> >
>> > But I am not able to build the spark-examples_2.11 project. There are
>> import
>> > issues in the java files like below:
>> > Eg: The import org.apache.spark.SparkConf cannot be resolved
>> > The import org.apache.spark.api.java.JavaSparkContext cannot be
>> resolved
>> > and so on displayed in eclipse.
>> >
>> > What am I doing wrong to run these examples?
>> >
>> >
>> > Best Regards,
>> > Subash Basnet
>>
>
>

Re: Unable to run spark examples in eclipse

Posted by subash basnet <ya...@gmail.com>.
Hello Jacek Laskowski,

I followed the link, installed sbt, scala. I can build the project via
terminal successfully, but when I import it to eclipse I get the following
error:

​And the spark sub-projects have all the import errors as before.

I have maven 3.3.9 in ubuntu, the same as default required maven version,
so project build fine via terminal.
My eclipse has 3.3.3 maven version, so I changed in  the spark/pom.xml the
required maven version from 3.3.9 to 3.3.3:
*<maven.version>3.3.3</maven.version>*

After the version change, it buids fine in eclipse also. But since there
are import errors in each java files, I am not able to run them
individually. How could I solve this issue.

​

Regards,
Subash Basnet

On Sat, Aug 13, 2016 at 3:48 AM, Jacek Laskowski <ja...@japila.pl> wrote:

> Hi,
>
> You need to add spark-* libs to the project (using the
> Eclipse-specific way). The best bet would be to use maven as the main
> project management tool and import the project then.
>
> Seen https://cwiki.apache.org/confluence/display/SPARK/
> Useful+Developer+Tools#UsefulDeveloperTools-Eclipse
> ?
>
> Pozdrawiam,
> Jacek Laskowski
> ----
> https://medium.com/@jaceklaskowski/
> Mastering Apache Spark 2.0 http://bit.ly/mastering-apache-spark
> Follow me at https://twitter.com/jaceklaskowski
>
>
> On Fri, Aug 12, 2016 at 10:49 AM, subash basnet <ya...@gmail.com>
> wrote:
> > Hello all,
> >
> > I am completely new to spark. I downloaded the spark project from github
> > (https://github.com/apache/spark) and wanted to run the examples. I
> > successfully ran the maven command:
> >
> > build/mvn -DskipTests clean package
> >
> > But I am not able to build the spark-examples_2.11 project. There are
> import
> > issues in the java files like below:
> > Eg: The import org.apache.spark.SparkConf cannot be resolved
> > The import org.apache.spark.api.java.JavaSparkContext cannot be resolved
> > and so on displayed in eclipse.
> >
> > What am I doing wrong to run these examples?
> >
> >
> > Best Regards,
> > Subash Basnet
>

Re: Unable to run spark examples in eclipse

Posted by Jacek Laskowski <ja...@japila.pl>.
Hi,

You need to add spark-* libs to the project (using the
Eclipse-specific way). The best bet would be to use maven as the main
project management tool and import the project then.

Seen https://cwiki.apache.org/confluence/display/SPARK/Useful+Developer+Tools#UsefulDeveloperTools-Eclipse
?

Pozdrawiam,
Jacek Laskowski
----
https://medium.com/@jaceklaskowski/
Mastering Apache Spark 2.0 http://bit.ly/mastering-apache-spark
Follow me at https://twitter.com/jaceklaskowski


On Fri, Aug 12, 2016 at 10:49 AM, subash basnet <ya...@gmail.com> wrote:
> Hello all,
>
> I am completely new to spark. I downloaded the spark project from github
> (https://github.com/apache/spark) and wanted to run the examples. I
> successfully ran the maven command:
>
> build/mvn -DskipTests clean package
>
> But I am not able to build the spark-examples_2.11 project. There are import
> issues in the java files like below:
> Eg: The import org.apache.spark.SparkConf cannot be resolved
> The import org.apache.spark.api.java.JavaSparkContext cannot be resolved
> and so on displayed in eclipse.
>
> What am I doing wrong to run these examples?
>
>
> Best Regards,
> Subash Basnet

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org