spark二次開發eclipse環境搭建

Java Build Path -> Source : spark/src/java

Java Build Path -> Libraries :

spark/build/lib/* , spark/build/lib/dist/*, spark/build/lib/dist/ext/*, spark/build/lib/merge/*,

spark/plugins/jingle/build/lib/dist/*, spark/plugins/spelling/build/lib/*, spark/src/commerial

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 clickYes.

  • 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 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 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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章