搭建windows下openfire调试环境
在eclipse中用ant进行编译、调试:下载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 (OrDebug->Debug Configurations)弹出一个对话框,在左侧菜单中右键点击Java Application,选择New创建启动配置
1.在Debug窗口的Main选项卡中, 修改最上面Name文本框中的值,改成包含要启动的类的工程名openfire(没什么用,就是一个标识,随便起名字。)
2.在Run窗口的Main选项卡中,project框中填写:openfireMain class 填写:org.jivesoftware.openfire.starter.ServerStarter点击Apply应用。
3.点击进入Arguments选项卡,在上面那个框(VM arguments:)中填写-DopenfireHome="E:\source\im\server\openfire\target\openfire"这里是我的openfire用ant编译后生成的目标位置,你的 openfire要根据你的项目位置来进行同步修改。点击Apply应用。
4.点击进入Classpath选项卡,选中User Entries,然后点击右侧的Advanced按钮,会弹出一个小框,选择Add External Folders,单击OK。选择 E:\source\im\server\openfire\i18n点OK 按钮将这个文件夹加入到Classpath选项卡中选择 E:\source\im\server\openfire\target\openfire\resources目录也加到 Classpath选项卡中选择Add External Jars:选择 E:\source\im\server\openfire\target\openfire\lib 中所有的jar文件。点击Apply应用。5.点击进入Common选项卡中,勾选Debug复选框。点击Apply应用。
在进行这些配置之后,就算是基本完工了。可以直接点击配置框最下方的Run按钮,或者单击菜单栏Run->Run开始跑程序。
工程->右键->Debug as->debug configurations:
设置好后,点debug,就可以开始有eclipse中调试openfire了。
页:
[1]