apache-spark导入eclipse环境

工作中用到了apache-spark,想深入了解一下,决定从源码开始。

先导入到常用的ide,eclipse吧:

准备工作

 1. 下载Eclipse:http://scala-ide.org/

 2. 从github上下载源码:https://github.com/apache/spark

第一个实验品是Spark-Core项目

  1. exist maven project 导入Eclipse

  2. Eclipse自动导入依赖,这个过程时间较长,请等待

  完成后,发现报错:

  spark build path is cross-compiled with an incompatible version of Scala (2.10.0)。。。

  原因:版本不一致

  • Scala IDE uses Scala 2.11.7
  • Apache Spark built with Scala 2.10

解决方法:

  选中scala libary container [2.11.7],点击右键,选中属性--->classpath container -->2.10 bundle.

  此时重新编译,编译完成ok,没有报错。

参考文献:

【1】https://cwiki.apache.org/confluence/display/SPARK/Useful+Developer+Tools#UsefulDeveloperTools-IDESetup

【2】http://stackoverflow.com/questions/34507966/spark-build-path-is-cross-compiled-with-an-incompatible-version-of-scala-2-10-0

【3】http://blog.csdn.net/yunlong34574/article/details/39213503