Spark-IDEA源码阅读环境搭建(Windows)
来源:互联网 发布:苹果手机安装不了淘宝 编辑:程序博客网 时间:2024/04/30 09:15
一、源码下载和IDE安装
下载Spark源码和 Intellij IDEA并安装
二、jdk和scala安装
1. jdk
下载jdk并安装完成后,环境变量配置省略,可以参考
http://blog.csdn.net/hylisncsb/article/details/47722399
2. scala
windows下,直接下载scala的安装包安装即可
三、Maven安装
直接下载Maven的压缩包,解压即可。
1. Maven 环境变量
1) 新建环境变量 M2_HOME ,输入值为 Maven 的安装目录;2) 将 M2 环境变量加入 Path 的最后,%M2_HOME%\bin3) 测试:mvn-v
2. Maven 仓库配置
由于GFW的原因,Maven的使用会遇到一些问题,现在使用开源中国提供的Maven仓库。 参见:http://maven.oschina.net/content/groups/public/
1) mirrors修改
<mirrors> <mirror> <id>nexus-osc</id> <mirrorOf>central</mirrorOf> <name>Nexus osc</name> <url>http://maven.oschina.net/content/groups/public/</url> </mirror> <mirror> <id>nexus-osc-thirdparty</id> <mirrorOf>thirdparty</mirrorOf> <name>Nexus osc thirdparty</name> <url>http://maven.oschina.net/content/repositories/thirdparty/</url> </mirror></mirrors>
2) 在执行 Maven 命令的时候, Maven 还需要安装一些插件包,这些插件包的下载地址也让其指向 OSChina 的 Maven 地址
<profile> <id>jdk-1.4</id> <activation> <jdk>1.4</jdk> </activation> <repositories> <repository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories></profile>
3) 本地仓库修改
<localRepository>localRepositoryPath</localRepository>
四、IDE
1. IDE Maven设置
IDE的配置在:“File”-> “Setting” -> “Build,Execution,Deployment” -> “Build Tool” -> “Maven”中。
如果配置好了Maven的setting.xml文件,那么IDE中Maven的home directory、User Setting File 和Local repository 会从setting中读取,不需要修改。
另外,为了在打开Spark工程时,IDE自动下载依赖,需要在Importing中,将“Import Maven projects automatically”选项勾选上。
2. 打开Spark project
在IDE中打开Spark的pom文件,IDE会自动根据pom中的依赖下载依赖包,这些依赖包会存放到Local repository中。
3. IDE的一些小问题
如果在IDE中编写测试代码,运行时可能会遇到:
"scalac: bad option: -P:/home/jakub/.m2/repository/org/scalamacros/paradise_2.10.4/2.0.1/paradise_2.10.4-2.0.1.jar".
解决方法是,在File”-> “Setting” -> “Build,Execution,Deployment” -> “Build Tool” -> “Compiler” -> “Scala Compiler” 的选显卡中,清空 ”Additional compiler options“ 的内容,然后再次运行即可。
4. little tips
1) 遇到java和scala相互转化的问题
import scala.collection.JavaConversion._
2) RDD[K,V] 向PairRDDFuctions
需要应用SparkContext,sc中定义了隐式的转换
- Spark-IDEA源码阅读环境搭建(Windows)
- Intellij IDEA搭建Spark源码阅读环境
- spark idea 源码阅读环境搭建
- Spark源码阅读环境搭建[Windows版]
- Spark源码学习-windows使用idea搭建源码阅读集群
- Spark源码阅读环境搭建(基于Intellij IDEA)
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Windows + IDEA + SBT 部署Spark源码阅读环境
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Spark源码之路(一):绝对靠谱,Windows下用IDEA搭建源码阅读环境
- spark源码阅读环境搭建
- 搭建Spark源码阅读环境
- 排序(2015-10-20)
- java 修饰符全解
- 学生成绩同一行显示或者课程安排按照一周星期的显示
- 小用hibernate二级缓存
- Hibernate常见错误
- Spark-IDEA源码阅读环境搭建(Windows)
- UI2_UILabel
- Servlet学习笔记--生成网站表单验证码
- hibernate.cfg.xml配置文件和hbm.xml配置文件
- 前台超出多少字省略号显示
- 项目开发
- Toolbar,DrawerLayout,PagerSlidingTabStrip 草丛三基友实现常规home页面
- 第三周 项目四 顺序表的应用
- iOS项目中全局变量的定义与使用