用Eclipse构建Spark源代码调试阅读环境

实验环境准备:

JDK Java 语言的软件开发工具包(SDK)

参考网址: http://www.oracle.com/technetwork/java/javase/downloads/index.html

SaclaIDE一个基于Eclipse开发的Scala的集成开发软件。(可直接用)

参考网址:http://scala-ide.org/

ScalaSpark是用Scala语言写成的,在本地编译执行需要这个包

参考网址:http://www.scala-lang.org/download/

SBTscala工程构建的工具

参考网址:http://www.scala-sbt.org/download.html

操作系统:windows7

 

注解(附件详细补充):可以先直接在官网下载Eclipse软件,之后可以在插件中找到Scala插件,也行,详细方案请参看最后后面的附件(纯Eclipse自己安装Scala插件的集成开发环境的构建)。

参考网址:http://www.eclipse.org/downloads/

 

第一部分、软件安装

1、  安装JDK (版本为1.7.0_11)

2、  安装Scala (版本为2.11.2)

3、  安装ScalaIDE(版本为3.0.4)

 

第二部分:加压缩官网下载的源代码包或者找到通过Git抽取的Spark源文件:

         我用的是spark-1.1.1版本(最新版本),由于idea 13已经原生支持sbt,所以无须为idea安装sbt插件。

源码下载(用git工具):

# Masterdevelopment branch

gitclone git://github.com/apache/spark.git

# 1.1 maintenancebranch with stability fixes on top of Spark 1.1.1

gitclone git://github.com/apache/spark.git -b branch-1.1

源码更新(用git工具同步跟新源码):

gitclone https://github.com/apache/spark.git

 

第三部分:通过sbt工具,构建Scala的Eclipse工程,详细步骤如下所示

1、通过cmd命令进入DOS界面,之后通过cd命令进入源代码项目中,我下载的Spark.1.1.1版本的源代码放在(E:\Spark计算框架的研究\spark_1_1_1_eclipse)文件夹中,之后运行sbt命令,如下所示:


2、运行sbt命令之后,解析编译相关的jar包,并出现sbt命令界面窗口,出现的效果图如下所示,之后运行eclipse命令,sbt对这个工程进行编译,构建Eclipse项目,效果图如下所示:

 

4、  打开ScalaIDE工具,File à Import à Existing Projects into Workspace à Next à 选择刚好用sbt工具编译好的Eclipse工程(E:\Spark计算框架的研究\spark_1_1_1_eclipse),如下图所示。


5、  通过上面的操作,就可以将通过sbt工具编译生成的Eclipse项目导入到EclipseIDE开发环境中,效果图如下所示:


错误提示如下所示:我导入的包为,如下文件夹中所示。

(E:\Spark计算框架的研究\spark_1_1_1_eclipse\lib_managed\bundles)

Description      Resource Path Location   Type

akka-remote_2.10-2.2.3-shaded-protobuf.jar is cross-compiled

with an incompatible version of Scala (2.10).

In case of errorneous report, this check can be disabled

in the compiler preference page.   

spark-core                 Unknown Scala Classpath Problem

 

Description      Resource Path Location   Type

akka-slf4j_2.10-2.2.3-shaded-protobuf.jar is cross-compiled with

an incompatible version of Scala (2.10). In case of errorneous report,

this check can be disabled in the compiler preference page.

spark-core                 Unknown Scala Classpath Problem

 

Description      Resource Path Location   Type

akka-testkit_2.10-2.2.3-shaded-protobuf.jar is cross-compiled

with an incompatible version of Scala (2.10).

In case of errorneous report, this check can be disabled in the compiler preference page.

spark-core                 Unknown Scala Classpath Problem

 

Description      Resource Path Location   Type

akka-zeromq_2.10-2.2.3-shaded-protobuf.jar is cross-compiled

with an incompatible version of Scala (2.10).

In case of errorneous report, this check can be disabled in the compiler preference page. 

spark-core                 Unknown Scala Classpath Problem

上面这些包兼容性问题还没有解决,修改相应的jar包就可以解决。

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值