中文版:
Openfire 是由Jive Software 主導開發的一套功能非常強大的開源im 服務器(前身是wildfire),它基於XMPP 協議,完全用java實現,是一款非常優秀的服務器端軟件。
四. check out openfire 源碼
----------------- 自己創建工程: 五.創建Java項目,將源代碼導入此項目中。在Eclipse中將此Java文件夾當成源代碼文件夾新建工程。庫都在Build目錄的lib目錄下,將openfire用到的庫都添加到這個新建工程的Referenced Libraries中。 六. Build openfire
設置完畢,這樣以後在run這個工程的時候就會按照正確的配置進行了.
英文版
|
- 下載安裝JDK1.6
- 下載安裝Eclipse 3.3
- 下載openfire源代碼
- 創建openfire項目
- Select Java::Java Project and click Next.
- On the New Java Project window choose Create project from existing source and browse to where openfire folder is located under your workspace.
- In the Project name box enter exactly as openfire.
- 編譯openfire
- Click Window::Show View::Ant menu.
- Right-click the Ant screen and choose Add Buildfiles…
- Expand the openfire::build folder and select build.xml, then click OK.
- On the Ant screen, expand the Openfire XMPP Server and double-click on openfire ant task. The build may fail because you’re checking out the daily updates of Openfire 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.
- 創建項目編譯器
- 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 Openfire or anything you like.
- Click on Project::Browse button and select openfire and click OK.
- Click on Main class::Search button and select ServerStarter – org.jivesoftware.openfire.starter 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 the Arguments tab.
- Enter -DopenfireHome=”${workspace_loc:openfire}/target/openfire” in the VM arguments box.
- 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 openfire::src::i18n folder and click OK.
- Click on the Advanced… and Add Folders buttons once again to include openfire::src::resources::jar folder.
- Click on Common tab.
- Select the Debug and Run check box.
- Click on Apply button.
- Click on Close button.
- 運行/調試
- The setting is now complete for Openfire.
- You may test running and debugging by clicking on Run::Run History::Openfire and Run::Debug History::Openfire respectively. If you choose the later and if you follow this instruction closely, execution will stop on the main method in ServerStarter.java.
自己寫的:
從這個網址下載源碼:http://www.igniterealtime.org/downloads/source.jsp;
接下來在Eclipse中新建工程,將源碼導入:
接下來:
openfire是用ant構建的,所以要先設置使得eclipse中每次編譯都使用內置的ant工具,保證編譯的正確執行。
1. eclipse中點擊Window->Show View->Ant
2. 在Ant 頁面點右鍵,選擇 Add Buildfiles...
3. 展開openfire/build文件夾,選擇build.xml, 點 OK.
4. 在Ant頁面, 展開Openfire XMPP Server,雙擊 openfire 任務
再接下來:(由於我的Eclipse的版本是3.4的,所以和上邊中、英文中說的不一樣。)
創建項目編譯器的路徑:
run-->Run configurations...
記錄一下用ant編譯openfire的過程:
注:我把openfire的源文件放到路徑:D:/Mayframework框架/消息組件下邊了。