(1) Download spark source code
To the official website download: OpenFire, Spark, Smack, where spark can only be downloaded using SVN, the source folder corresponds to OpenFire, Spark and Smack respectively.
Download OpenFire, smack source code directly
: http://www.igniterealtime.org/downloads/source.jsp
Download spark source code using SVN mode
1. Install subversive plugin for Eclipse
a start eclipse
 B Click Help->install New software...->add
c input box name input subversive, and enter http://www.polarion.org/in the URL input box Projects/subversive/download/1.1/update-site (the latest subversive URL address is queried on http://www.eclipse.org/subversive )
D Click Finish to start the installation Subversive,eclipse will search the website and display the features you want to install in the next window, select Install subversive SVN Team Provider Plugin and subversive Client libraries all the features below
E Click Next,eclipse to start the installation, Restart Eclipse
After installation is complete
2. Download the spark code with SVN
A Click below Windows::open perspective::other ...
B pop up an "Open Perspective" dialog, select "SVN Repository exploring" and click OK
C when the Eclipse interface changes, right-click on the "SVN repositories" panel on the left and select New::repository location ...
D enter "Http://svn.igniterealtime.org/svn/repos" at "New Repository location", click "Finish"
E will change on the SVN repositories panel, expand it and find the Spark option, right-click on the trunk entry under Spark and select "Check out" to download the spark code
F When the download is complete, select Window::open Perspective::java, and on the Project Explorer panel you will see the Spark project, delete it, and in the Pop-up dialog box, select Do not delete conte NTS ", then find the Spark folder under the working directory, which is the source code for spark
Use SVN client to download spark source code from official website
1. Create a new folder as the root of the checked-out file, named spark_2.6.1, open the folder, right-click in the white space and SVN checkout (you have to install the SVN client right button to have this menu)
2. "Repository URL:" Enter the official website Http://svn.igniterealtime.org/svn/repos/spark, and then click to browse (the picture red button, note must go in to browse, otherwise it will be all the version of the official website download down, Will be very big super slow)
3. We will see the following tree, where the trunk is the latest version, tags is the previous version, if you want to download the latest version on the left side of the trunk or the right double-click the Trunk folder, if you want to download another version of the tags folder, then select the folder to download, and then OK- > OK, start the download.
(2) Import Project
1. Open Eclipse.
2. Create Java project, named Spark (this name is recommended), select "Create Project from existing source" in its contents, and add the folder where the spark source code files are downloaded.
or create a new folder named Spark in the Eclipse Workspace Workplace folder, copy the downloaded Spark source code three folders (such as) and paste it into the new Spark folder. Restart Eclipse to navigate to this workplace, right-->new->java Project under Package Explorer, named Spark (where the new folder name in workplace is the same), After finish, the project is loaded directly in.
After loading there will be some red error and yellow warning, the other tutorial said the red error of the package directly removed, in fact, do not delete has no effect.
3. Shown in Eclipse's Package Explorer:
(3) Build, compile, and run spark
Generate Spark
1. Click Window->show view->ant
2. Right-click the Ant panel and select Add Buildfiles
3. Expand the Build folder under Spark, select the Build.xml file, click OK
4. In the Ant panel, expand Spark, and double-click "Release[default", as shown on the right.
5. Wait for a while to prompt "BUILD successful" (if not shown, double-click "Release[default")
Always show build FAILED, prompting must use ant 1.6.x or higher to build Spark, which shows that eclipse comes with a lower ant version and needs to modify Eclipse's ant between 1.6.x ~1.7.x:
A Windows---Preferences---Ant---Runtime
B check ant Home Entries (Default) Click on the left arrow, expand the inside of the jar package, the inside of the jar all deleted
C Click Add External JARS ... Go to the downloaded version of Ant's installation directory (C:\Apache spark\apache-ant-1.7.0\lib) and add the full jar of directories to the directory.
6. Create the target folder, and when you recompile, delete this folder manually
Compiling spark
1. Click Run->run Configurations
2. Click Main
Name Fill in:Spark
Project:Spark(choose Spark Engineering)
Mainclass:org.jivesoftware.launcher.Startup(startup Class)
Tick stop in Main
3. Click on the Classpath tab
Select User Entries to make advanced. The button becomes available. Click the Advanced button. In the pop-up Options window, select Add Folders, then click OK, select Spark::src::resources folder in the Folders Selection window, click OK
4. Select the Common tab and tick the box in front of Debug,run. Click Apply, and then click Close.
Run Spark
The deployment, compilation, and operation of Spark source code in Eclipse3.5.2