3

I'm very new to java and feel very confused. I'm trying to create a VERY basic plugin for the OpenFire server, but have no idea how to get started. I read the Developer Guide, but it doesn't explain how to set everything up in eclipse. Do you have any good tutorials on how to create plugins for other applications in java? Like, how do I import all the openfire classes for instance? I get errors for all these lines of code:

package org.jivesoftware.openfire.plugin; //error is: The declared package "org.jivesoftware.openfire.plugin" does not match the expected package ""

import org.jivesoftware.admin.AuthCheckFilter; //errors are: The import org.jivesoftware cannot be resolved
import org.jivesoftware.openfire.MessageRouter;
import org.jivesoftware.openfire.XMPPServer;

My background is in C# so the syntax all looks nearly identical, but I have no idea how to use eclipse or how java works for plugins (seems very different than DLLs).

Thank you so much!

4

3 回答 3

5

你好可以按照我的步骤

  1. 获取openfire代码
  2. 在源代码中你会得到插件文件夹,你应该把你的插件放在那里。遵循 openfire 插件结构。或者只是为了简单起见复制和修改插件之一
  3. 然后你可以按照这个链接来编译它。http://community.igniterealtime.org/docs/DOC-1200
于 2011-10-27T07:09:28.703 回答
0

意识到我需要使用 Ant 而不是 Eclipse 进行编译,现在一切正常。希望插件能在几天内完成 =)

于 2011-06-11T00:20:31.757 回答
0

根据您上面所写的内容,我强烈建议您先对 Java 有一个更好的总体了解,然后再直接开发 Openfire 插件。

第一行暗示了对包的误解。我建议查看诸如Java Package Tutorial之类的教程,但本质上 package 语句应该与您放置此源文件的文件夹结构相匹配。

导入错误表明您不了解类路径的概念。谷歌是你的朋友,但信息来源之一是

正如我所说,我真的认为您应该首先掌握 Java 的基础知识,通过编写简单的小程序,然后逐步开发 Openfire 插件——您必须在其中与 3rd 方代码进行交互。

于 2011-06-09T14:29:33.717 回答