zoukankan      html  css  js  c++  java
  • openfire+elipse的导入配置


    中文版:

    2009-01-11 13:33

           Openfire 是由Jive Software 主导开发的一套功能非常强大的开源im 服务器(前身是wildfire),它基于XMPP 协议,完全用java实现,是一款非常优秀的服务器端软件。


    一. 安装JDK(我使用的是JDK1.6), 不再详述
    二. 安装 Eclipse 3.3(不再详述)
    三. 安装Subversive插件
         Subversive是一款不错的svn插件,具体安装方法请参看我的另一篇文章《Eclipse中安装svn插件Subversive 》,链接
    http://blog.csdn.net/zhenyucheung/archive/2008/03/19/2195518.aspx

    四. check out openfire 源码
       1. 在eclipse中点击Windows->Open Perspective->Other
       2. 在弹出窗口中点击SVN Repository Exploring 然后点OK
       3. 在SVN Repositories 点右键,选择 New->Repository Location...
       4. 在弹出的New Repository Location页面,将
    http://svn.igniterealtime.org/svn/repos输入URL文本框, 点 Finish. 你将会看到页面出现URL地址.
       5. 展开URL地址
       6. 展开openfire树形结构
       7. 在trunk上点击右键,选择Check Out
       剩下的就是等待check out完成了 :)


    五. 创建openfire工程
    对使用过eclipse的人来说,这一步不用多说,这里仅列出几个需要注意的地方.
    1. check out完毕后,eclipse会自动创建一个openfire工程,请把它删除(注意删除时不要删除content),否则你将不得不手动配置一些开发环境。
    2. 用Create project from existing source新建工程,注意工程名要用openfire。

    -----------------

       自己创建工程:

    五.创建Java项目,将源代码导入此项目中。在Eclipse中将此Java文件夹当成源代码文件夹新建工程。库都在Build目录的lib目录下,将openfire用到的库都添加到这个新建工程的Referenced Libraries中。

    六. Build openfire
    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 ant 任务


    七. 创建项目Builder
    1. 点击Run->Open Run Dialog...
    2. 选择Java Application,点击 New 按钮
    3. 在Run窗口的Main选项卡中, 修改Name文本框中的值,改成Openfire,其他名字亦可
    4. 点Browse按钮,选择openfire, 点ok
    5. 点Search按钮,选择Main class为org.jivesoftware.openfire.starter.ServerStarter,点OK。(这是openfire的启动类)
    6. 点击进入Arguments选项卡
    7. 在VM arguments文本框中输入 -DopenfireHome="${workspace_loc:openfire}/target/openfire",这个是用于eclipse执行java命令时传递的参数,这样openfire程序可以通过System.getProperty(“openfireHome”)得到 openfire的本地位置。
    8. 点击进入Classpath选项卡
    9. 点选User Entries,这样Advanced...就处于可用状态
    10. 点击Advanced...按钮
    11. 在Advanced Options页面,选择Add Folders, 点ok.
    12. 选择openfire\src\i18n, 点ok将这个文件夹加入到class path,同样的方式把openfire\src\resources\jar也加到class path中。
    13. 在Common选项卡中,点选Run复选框。

    设置完毕,这样以后在run这个工程的时候就会按照正确的配置进行了.


    英文版

     

    1. 下载安装JDK1.6
    2. 下载安装Eclipse 3.3
    3. 下载openfire源代码
      1. http http://www.igniterealtime.org/downloads/index.jsp
      2. svn http://svn.igniterealtime.org/svn/repos
    4. 创建openfire项目
      1. Select Java::Java Project and click Next.
      2. On the New Java Project window choose Create project from existing source and browse to where openfire folder is located under your workspace.
      3. In the Project name box enter exactly as openfire.
    5. 编译openfire
      1. Click Window::Show View::Ant menu.
      2. Right-click the Ant screen and choose Add Buildfiles…
      3. Expand the openfire::build folder and select build.xml, then click OK.
      4. 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.
    6. 创建项目编译器
      1. Click Run::Open Run Dialog… or Run::Open Debug Dialog… menu. A Run window shows.
      2. Select Java Application and click on the New button.
      3. On the Main tab of the Run window, change the New_configuration name to Openfire or anything you like.
      4. Click on Project::Browse button and select openfire and click OK.
      5. Click on Main class::Search button and select ServerStarter – org.jivesoftware.openfire.starter and click OK.
      6. I’d suggest that you select Stop in main check box so that you could later verify that debugging works.
      7. Click on the Arguments tab.
      8. Enter -DopenfireHome=”${workspace_loc:openfire}/target/openfire” in the VM arguments box.
      9. Click on Classpath tab.
      10. Select User Entries so that the Advanced… button will be enabled.
      11. Click on the Advanced… button.
      12. On the Advanced Options window select Add Folders and click OK.
      13. On the Folder Selection window select openfire::src::i18n folder and click OK.
      14. Click on the Advanced… and Add Folders buttons once again to include openfire::src::resources::jar folder.
      15. Click on Common tab.
      16. Select the Debug and Run check box.
      17. Click on Apply button.
      18. Click on Close button.
    7. 运行/调试
      1. The setting is now complete for Openfire.
      2. 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框架\消息组件下边了。

  • 相关阅读:
    dede图片横向滚动
    dede各种运用[转]
    PROFIBUS-DP现场总线的结构及应用
    51单片机的中断优先级及中断嵌套
    WPF里面制作圆角文本框
    【转】什么叫51单片机最小系统
    【转】(C#)OPC客户端源码
    路漫漫其修远兮,吾要上下左右前后而求索
    二叉树创建为什么用二级指针
    无向图的邻接表创建
  • 原文地址:https://www.cnblogs.com/zhouxiuquan/p/1912367.html
Copyright © 2011-2022 走看看