按照之前的导入方法成功导入后,报错消失了,这时候用eclipse编译openfire。
(1)在eclipse的菜单栏中,选择Run->Open Run Dialog...,在弹出的对话框左侧的树形结构中选择Java Application,单击右键,选择New创建启动配置。
(2) 在Run窗口的Main选项卡中, 修改Name文本框中的值,改成包含要启动的类的工程名openfire
(3)在Run窗口的Main选项卡中,点Browse按钮,选择openfire
(4)在Run窗口的Main选项卡中,点Search按钮,选择Main class为
org.jivesoftware.openfire.starter.ServerStarter,单击Apply按钮。(这是openfire的启动类)
(5)点击进入Arguments选项卡,在VM arguments文本框中输入
-DopenfireHome="${workspace_loc:openfire}/target/openfire"
单击Apply按钮。这个是用于eclipse执行java命令时传递的参数,这样openfire程序可以通过System.getProperty(“openfireHome”)得到openfire的本地位置。
(6)点击进入Classpath选项卡,选中User Entries,这样Advanced...就处于可用状态;点击Advanced...按钮,在Advanced