Spark,是一个不错的Jabber客户端,跟openfire出自同一个地方,可以说是跟openfire成为一套功能强大的即时通讯软件,特别是它是免费而且是开源的,你完全可以把它打造成自己的客户端.下面是介绍如何用eclipse来调试spark,同样也是来自Ignite Realtime社区.
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'strunkdirectory. If you only want the released/stable version, checkout the desired release from under thetagsdirectory.
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 useEclipse IDE for Java EE Developers. You should at least useEclipse IDE for Java Developers.
- Extract the downloaded zip file intoC:/Program Files/Eclipse.
- OpenC:/Program Files/Eclipsefolder.
- Right click and drageclipse.exeon to your desktop (or Windows taskbar) to create a shortcut icon.
- Right click the shortcut icon and chooseProperties. TheEclipse Propertieswindow will show.
- TheTargettextbox 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 theEclipse Propertieswindow.
Install Subversive Plugin
- Double-click the shortcut icon to start Eclipse.
- Select/enter your preferred workspace and clickOKto open Eclipse main IDE window.
- Click on theWorkbenchicon to close the welcome screen.
- ClickHelp::Software Updates::Find and Install...menu.
- Click onSearch for new features to installand clickNext.
- Click onNew Remote Site...button.
- EnterSubversivein theNamebox andhttp://www.polarion.org/projects/subversive/download/1.1/update-sitein the URL box (Check the latest URL fromhttp://www.eclipse.org/subversivewebsite), then clickOK.
- ClickFinishto 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 underSubversive SVN Team Provider PluginandSubversive Client Libraries.
- ClickNextto continue and so on until the installation ends. You normally want to restart Eclipse when the installation ends.
Check Out Spark SVN
- ClickWindows::Open Perspective::Other...menu.
- Click onSVN Repository Exploringon theOpen Perspectivewindow and clickOK.
- Right-click onSVN Repositoriesscreen and chooseNew::Repository Location...
- OnNew Repository Locationenterhttp://svn.igniterealtime.org/svn/reposin the URL box and clickFinish. You'll see the URL location in theSVN Repositoriesscreen.
- Expand the URL location.
- Expand thesparktree.
- Right-click ontrunkand chooseCheck Out. Make yourself some Mocha while waiting for the checkout to complete.
Create Spark Project
- ClickWindow::Open Perspective::Javamenu.
- In theProject Explorerscreen, if there is asparkproject, 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 theConfirm Project DeletechooseDo not delete contents, then clickYes.
- ClickFile::New::Project...Notice the ellipses!!!
- SelectJava::Java Projectand clickNext.
- On theNew Java Projectwindow chooseCreate project from existing sourceand browse to wheresparkfolder is located under your workspace.
- In theProjectnamebox enter exactly asspark. Otherwise, theNextandFinishbutton remain disabled. Click onNext. 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 onFinish.
- If theOpen Associated Perspectivewindows opens, click Yes.
Build Spark
- ClickWindow::Show View::Antmenu.
- Right-click theAntscreen and chooseAdd Buildfiles...
- Expand thespark::buildfolder and selectbuild.xml, then clickOK.
- On theAntscreen, expand theSparkand double-click onreleaseant 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
- ClickRun::Open Run Dialog...orRun::Open Debug Dialog...menu. ARunwindow shows.
- SelectJava Applicationand click on theNewbutton.
- On theMaintab of theRunwindow, change theNew_configurationname toSparkor anything you like.
- Click onProject::Browsebutton and selectsparkand clickOK.
- Click onMain class::Searchbutton and selectStartup - org.jivesoftware.launcherand clickOK.
- I'd suggest that you selectStop in maincheck box so that you could later verify that debugging works.
- Click onClasspathtab.
- SelectUser Entriesso that theAdvanced...button will be enabled.
- Click on theAdvanced...button.
- On theAdvanced Optionswindow selectAdd Foldersand clickOK.
- On theFolder Selectionwindow selectspark::src::resourcesfolder and clickOK.
- Click onCommontab.
- Select theDebugandRuncheck box.
- Click onApplybutton.
- Click onClosebutton.
Run/Debug
- The setting is now complete for Spark.
- You may test running and debugging by clicking onRun::Run History::SparkandRun::Debug History::Sparkrespectively. If you choose the later and if you follow this instruction closely, execution will stop in the main method ofStartup.java.