方法一:
download spark-core: http://central.maven.org/maven2/org/apache/spark/spark-core_2.10/1.0.0/spark-core_2.10-1.0.0.jar
Right click your project -> Build -> Configure build path
Add the downloaded .jar via “Add External JARs” and press OK.
Then, expand the spark-core.jar item (black arrow left from spark-core)
Edit the Javadoc location to http://spark.apache.org/docs/latest/api/java
Apply -> Ok
方法二:
.
Just follow these simple steps :
Download this jar file org.apache.spark.api
Right click on eclipse’s project -> Build -> Configure build path
Select Java build path -> choose Libraries -> Add External jar
Select org.apache.spark.api And then OK
Now check,Spark api is add in your project.
I think it will work.