其实关于这个问题在Spark的官网www.igniterealtime.org上有很详尽的介绍,因此本文大部分内容是从英文文档引用而来的,其中还有一些个人的经验。

Spark源代码:下载地址

想了解更多关于"Spark"的文章,请点击这里.

安装JDK

这个不用说了,注意版本,最少要1.5,推荐使用

安装Eclipse3.3

a) 从官网下载Eclipse 3.3 (对Java开发者用的)

b) 假设你把eclipse安装在c:/program files/eclipse,进入这个文件夹,为eclipse.exe创造一个桌面图标,右击这个图标,选择“属性”,打开属性对话框,在“目标”的输入框里,输入如下

"C:\Program Files\Eclipse\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0\bin\javaw"

熟悉eclipse的都知道这是为eclipse指定使用哪个Java VM。

为eclipse安装Subversive插件

a)用上面建的图标打开eclipse,下面开始安装Subversive插件,由于我用的是英文版的ecplipse,

下面的菜单我都用英文。

b) 点击Help::Software Updates::Find and Install...

c)点击 Search for new features to install ,点Next

d)点New Remote Site... 按钮

e)在name的输入框里输入 Subversive ,并且在URL输入框里输入http://www.polarion.org/projects/subversive/download/1.1/update-site

(最新的Subversive地址上http://www.eclipse.org/subversive查询)

f)点击Finish ,开始安装Subversive,eclipse将搜索网站,并且在下一个窗口中显示你想安装的功能

选择安装Subversive SVN Team Provider Plugin 和Subversive Client Libraries下面所有的功能

g)     点Next,eclipse开始安装过程,安装结束后重启eclipse。

利用svn方式下载spark代码

a)点击如下Windows::Open Perspective::Other...

b)弹出一个“Open Perspective”对话框,选择“SVN Repository Exploring”,单击OK

c)这是eclipse界面发生变化,在左边的“ SVN Repositories”面板上,右击鼠标

选择New::Repository Location...

d)在“New Repository Location”的位置输入

“http://svn.igniterealtime.org/svn/repos”,单击 “Finish”

e)在SVN Repositories面板上,会发生变化,展开它,找到spark的选项,右击

spark下面的trunk项,选择“Check Out”,下载spark的代码。

f)下载完成后,选择Window::Open Perspective::Java,在Project Explorer面板上,

看到Spark项目,删掉它,在弹出来的对话框中选择“Do not delete contents”

在工作目录下面找到spark文件夹,里面就是spark的源代码。

注:也可以不要这么麻烦,我在上面提供了一个链接,可以直接下载Spark源代码,上面的步骤都

可以省了.

创建Spark项目

1)点击Window::Open Perspective::Java菜单

2)在Project Explorer窗口中,如果有spark这个项目,把它删了,删除时,会问你要不要删除

文件,选择不要.

3)选择File::New::Project...,再选择Java::Java Project,在New Java Project窗口选择

"Create project from existiing source",然后把spark文件所在的文件夹加进去.

4)在"project name"中输入spark,要和文件夹的名字相同.

5)点Finish.

生成Spark

1)点击Window::Show View::Ant

2)右击Ant面板,选择Add Buildfiles

3)展开spark::build文件夹,选择build.xml,点击"OK"

4)在Ant面板,展开Spark,双击"release",等一段时间,会提示"Build Successful".

Create Project Builder1)点击Run::Open Debug Dialog...,出现"Run"窗口

2)选择"Java Application",点击"New"按钮.

3)在"Main"标签页,将New_configuration换成Spark或其它的这个无所谓.

4)点击Project::Browse按钮,选择Spark,再点OK.

5)点击Main class::Search按钮,选择main所在的类Startup-org.jivesoftware.launcher,

再点击OK

6)建议勾选Stop in main.

7)点击Classpath标签页,选择User Entries ,使得Advanced..按钮变的可用.点击Advanced

按钮.

8)在弹出来的Advanced Options窗口,选择Add Folders,再点OK,在Folder Selection窗口

选择spark::src::resources 文件夹,点击OK

9)选择Common标签页,勾选Debug,Run前面的框

10)点击Apply,再点击Close

Run/Debug

点击Run::Open Run Dialog..,在弹出的对话框选择Spark,然后点Run就行了.

英文文档如下:

This guide assumes that you are installing everything from scratch. If you've done some parts of them, this guide may still be useful. I compile this guide to the best of my knowledge. I apologize if it doesn't work for you.

Notes:

This guide assumes that you want the latest updates of the source i.e. from the project's trunk directory. If you only want the released/stable version, checkout the desired release from under

the tags directory.

Install JDK

Download JDK and install them. The least version should be 1.5. I use 1.6. Sorry, no instruction for this.

Install Eclipse 3.3

Download Eclipse 3.3 from www.eclipse.org. I use Eclipse IDE for Java EE Developers. You should at least use Eclipse IDE for Java Developers.

Extract the downloaded zip file into C:/Program Files/Eclipse.

Open C:/Program Files/Eclipse folder.

Right click and drag eclipse.exe on to your desktop (or Windows taskbar) to create a shortcut icon.

Right click the shortcut icon and choose Properties. The Eclipse Properties window will show.

The Target textbox should read something like this "C:\Program Files\Eclipse\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0\bin\javaw" depending on the JDK that you use and where you installed it.

Close the Eclipse Properties window.

Install Subversive Plugin

Double-click the shortcut icon to start Eclipse.

Select/enter your preferred workspace and click OK to open Eclipse main IDE window.

Click on the Workbench icon to close the welcome screen.

Click Help::Software Updates::Find and Install... menu.

Click on Search for new features to install and click Next.

Click on New Remote Site... button.

Click Finish to install Subversive. Eclipse will search for the update site and show the result in a next window where you will select the features to install. I choose everything under Subversive SVN Team Provider Plugin and Subversive Client Libraries.

Click Next to continue and so on until the installation ends. You normally want to restart Eclipse when the installation ends.

Check Out Spark SVN

Click Windows::Open Perspective::Other... menu.

Click on SVN Repository Exploring on the Open Perspective window and click OK.

Right-click on SVN Repositories screen and choose New::Repository Location...

On New Repository Location enter Finish. You'll see the URL location in the SVN Repositories screen.

Expand the URL location.

Expand the spark tree.

Right-click on trunk and choose Check Out. Make yourself some Mocha while waiting for the checkout to complete.

Create Spark Project

Click Window::Open Perspective::Java menu.

In the Project Explorer screen, if there is a spark project, delete it. This project was created during the Spark check out process. Yes you read it correctly, DELETE the project!!! Otherwise you'll have to setup your Spark development environment manually. On the Confirm Project Delete choose Do not delete contents, then click Yes.

Click File::New::Project... Notice the ellipses!!!

Select Java::Java Project and click Next.

On the New Java Project window choose Create project from existing source and browse to where spark folder is located under your workspace.

In the Project name box enter exactly as spark. Otherwise, the Next and Finish button remain disabled. Click on Next. Eclipse will read the directory structure to setup the environment automatically (almost) for you and you can see what it does on the next screen. Then click on Finish.

If the Open Associated Perspective windows opens, click Yes.

Build Spark

Click Window::Show View::Ant menu.

Right-click the Ant screen and choose Add Buildfiles...

Expand the spark::build folder and select build.xml, then click OK.

On the Ant screen, expand the Spark and double-click on release ant task. The build may fail because you're checking out the daily updates of Spark sources, which may contain bugs. If so, wait for another day and hope that the developers discover and fix the bug; or you might dare to fix it yourself. During this first time setup, a successful build is necessary before you can proceed with the remaining tasks below.

Create Project Builder

Click Run::Open Run Dialog... or Run::Open Debug Dialog... menu. A Run window shows.

Select Java Application and click on the New button.

On the Main tab of the Run window, change the New_configuration name to Spark or anything you like.

Click on Project::Browse button and select spark and click OK.

Click on Main class::Search button and select Startup - org.jivesoftware.launcher and click OK.

I'd suggest that you select Stop in main check box so that you could later verify that debugging works.

Click on Classpath tab.

Select User Entries so that the Advanced... button will be enabled.

Click on the Advanced... button.

On the Advanced Options window select Add Folders and click OK.

On the Folder Selection window select spark::src::resources folder and click OK.

Click on Common tab.

Select the Debug and Run check box.

Click on Apply button.

Click on Close button.

Run/Debug

The setting is now complete for Spark.

You may test running and debugging by clicking on Run::Run History::Spark and Run::Debug History::Spark respectively. If you choose the later and if you follow this instruction closely, execution will stop in the main method of Startup.java

Java查询spark中生成的文件,spark原代码生成方法相关推荐

  1. Java查询spark中生成的文件_java+spark-sql查询excel

    Spark官网下载Spark 下载Windows下Hadoop所需文件winutils.exe 同学们自己网上找找吧,这里就不上传了,其实该文件可有可无,报错也不影响Spark运行,强迫症可以下载,本 ...

  2. java在linux生成pdf文件,从 Java 应用程序动态生成 PDF 文件

    简介: 如果您的应用程序需要动态生成 PDF 文档,那么您需要 iText 库.开源的 iText 库使得 PDF 的创建变得轻松易行.本文介绍了 iText 并提供了一个使用它从 Java 技术应用 ...

  3. vector与结构体联合使用 在磁盘中生成.txt 文件

    一下纯属个人总结.欢迎拍砖!谢谢 我意思到以练促进学习C++编程基础是很有帮助的 这篇文章是我为了熟悉掌握文件流和STL中的vector以及结构体三个只知识点所写的代码: #include <s ...

  4. python在内存中生成Zip文件!

    python在内存中生成Zip文件! - 天真的好蓝啊 - 博客园 python在内存中生成Zip文件! import zipfile import StringIO class MemoryZipF ...

  5. android 构造xml,android 中生成xml文件

    在Android中生成xml文件真的很简单,下面提供2中方法,一种是通过String写入到文件,另外一种是通过XML 的 XmlSerializer. 以后遇到Android写xml内容就不会困惑了 ...

  6. 在 Apex 代码中生成 csv 文件

    在 Apex 代码中生成 csv 文件可以写一个 Visualforce 页面,设定类型为 excel 的格式,然后调用 PageReference 的 getContent()方法来获取 Blob ...

  7. java查询数组中元素的索引

    java查询数组中元素的索引 /*** java查询数组中元素的索引*/ public class Test03 {public static void main(String[] args) {in ...

  8. java指令导出data文件_直接用 java 命令行动态生成jpg文件 (转)

    直接用 java 命令行动态生成jpg文件 (转)[@more@] /** * jeruGraphics v 1.0 * * 看到一些动态生成图象的例子都是完成的, * 而且很长,觉得不是无论从实用性 ...

  9. 在F5 BIG IP版本9中生成CSR文件的教程

    在申请SSL证书时,申请者必须为您的 Web 服务器上的域名或主机名创建证书签名请求 (CSR).CSR是向证书颁发机构 (CA) 发送您的公钥的标准化方式,该公钥与服务器上的秘密私钥配对,并提供有关 ...

最新文章

  1. android studio 库项目管理,在Android Studio中将现有项目转换为库项目
  2. 【 js 片段 】如何组织表单的默认提交?【亲测有效】
  3. NumPy和Pandas常用库
  4. “约见”面试官系列之常见面试题第十一篇之canvas(建议收藏)
  5. Yii 2.0 GII 访问404错误
  6. ASP.NET页面之间传值的方式之Cookie(个人整理)
  7. android fota解决方案,Android智能终端FOTA方案的制作方法
  8. java snmpv3_snmpv3 java实现
  9. 固态硬盘颗粒有哪些?固态硬盘SLC、MLC、TLC、QLC有什么不同?
  10. 适合小白的LayaAir使用说明(创建laya的简易程序教程1.0)
  11. DIY个人智能家庭网关—— 路由器篇之申请公网IP
  12. 膜拜大神,Linux之父家中停电6天,竟然还码出新版Linux内核!
  13. 读《企业中的开放源代码》有感
  14. Kafka Shell Lag
  15. 数据分析的基本思想是什么
  16. linuxcnc 安装详细教程
  17. 日常开发中的一些js处理数据的方法,包括对数据的过滤,以及对数据的验证
  18. 万能pdf转换器 V4.1
  19. REST表述性状态传递
  20. 会议室分配时间最长_面试真题 | 3个会议室,现在有6个会议,你会如何安排?vvvv...

热门文章

  1. 管理类软件设计“渔”之演化
  2. 基于约束的SQL攻击
  3. vue - v-if 注意点
  4. android释放焦点_Android videoview抢占焦点的处理方法
  5. 两列布局左边定宽,右边自适应
  6. CNN结构:序列预测复合DNN结构-AcGANs、 ENN误差编码网络
  7. C++的Android接口---配置NDK
  8. 通用计算机有哪四个部分,计算机硬件由哪几部分组成?各部分的作用是什么?...
  9. 用户模式 linux救援单用户 (补充)
  10. day12-mysql 事务与索引