eclipse 編譯、調試 Spark

來源:互聯網
上載者:User

Spark,是一個不錯的Jabber用戶端,跟openfire出自同一個地方,可以說是跟openfire成為一套功能強大的即時通訊軟體,特別是它是免費而且是開源的,你完全可以把它打造成自己的用戶端.下面是介紹如何用eclipse來調試spark,同樣也是來自Ignite Realtime 社區.

Spark SVN + Eclipse 3.3 + Subversive Installation GuideVERSION 3 PublishedCreated on: Aug 23, 2007 2:06 PM by aznidin - Last Modified:  Aug 27, 2007 8:49 PM by aznidinThis 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.
  • Enter Subversive in the Name box andhttp://www.polarion.org/projects/subversive/download/1.1/update-site in
    the URL box (Check the latest URL from http://www.eclipse.org/subversive website), then click OK.
  • 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 http://svn.igniterealtime.org/svn/repos in the URL box
    and clickFinish. 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 sparkfolder 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::Sparkrespectively. If you choose the later and if you follow this instruction closely, execution will stop in the main method
    of Startup.java.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.