日期:2014-05-16  浏览次数:20820 次

搭建windows下openfire调试环境

下载openfire源码:

svn co http://svn.igniterealtime.org/svn/repos/openfire/trunk openfire

 

导入工程:

File->New->project:

选择“Java project from existing ant buildfile”

打开ant编译工程:

 

再从菜单windows->show view->ant 打开ant工具对话框:

打开ant编译文件build.xml:

 

当编译完成后,在源码根目录下会生成一个target目录:

 

选择run选项点运行,就开始了用ant运行openfire了。也可以直接运行target/openfire/bin/openfire.bat

 

现在设置eclipse来调试openfire:

点击openfire项目,在菜单栏中选择Run->Open Debug Dialog (Or  Debug->Debug Configurations)

弹出一个对话框,在左侧菜单中右键点击Java Application,选择New创建启动配置

 

1.在Debug窗口的Main选项卡中, 修改最上面Name文本框中的值,改成包含要启动的类的工程名openfire

(没什么用,就是一个标识,随便起名字。)

 

2.在Run窗口的Main选项卡中,

project框中填写:openfire

Main class 填写:org.jivesoftware.openfire.starter.ServerStarter

点击Apply应用。

 

3.点击进入Arguments选项卡,在上面那个框(VM arguments:)中填写

-DopenfireHome="E:\source\im\server\openfire\target\openfire"

这里是我的openfire用ant编译后生成的目标位置,你