Plugin - Dev Environment on Linux

Hello,

My goal is to set up a dev environment for developing and testing OpenFire plugins. I am new to java but I am an experienced developer so I’'m hoping I can get up and running fairly quickly. My questions are related to setting up a working dev environment.

I am running Fedora 6 and I have jdk 1.5 installed

  • In order to develop plugins, do I need to build and install the OpenFire sources or can I use the binaries?

  • What is the best environment for developing these plugins on Linux? I understand I need Ant. I tried to install Ant but I stopped after it asked me for a whole bunch of packages and libraries (both java and X-windows related), which makes me think my java installation is incomplete (java sdk needed?)

  • Which debugger is available - Eclipse? Would I need to run it over X and connect remotely? I’'d rather use a non-graphic tool, in a terminal shell.

Sorry these questions are so basic, Thanks for any help. --LT

I use the following tools for developing:

  • Fedora Core 6 Linux

  • Java JDK 1.5u9

  • Ant 1.7.0

  • Openfire 3.3.0 Sources (so my plugins are backwards compatible)

  • KWrite (powerful Texteditor)

  • Konqueror (Filebrowser)

  • multiple console windows

  • multiple browser windows/tabs for documentation.

  • Psi 0.10 (Jabber-Client, has XML-Console)

  • current Openfire installation for testing

In my opinion the best and simplest way for debugging is using Openfires build in Log mechanism and/or sending messages to yourself.

Coolcat

Message was edited by: Coolcat

Hi LT, welcome to Jive community.

  • In order to develop plugins, do I need to build and install the OpenFire sources or can I use the binaries?

Openfire source contains a build file for plugins. To compile your plugin, the plugin source must be placed under the the appropriate directory of Openfire directory structure as mentioned somewhere in the Plugin Developer Guide. So, yes you need to download Openfire source.

  • What is the best environment for developing these plugins on Linux? I understand I need Ant. I tried to install Ant but I stopped after it asked me for a whole bunch of packages and libraries (both java and X-windows related), which makes me think my java installation is incomplete (java sdk needed?)

The choice is up to you. For Jive devs, the best tool for them could be InteliJ IDEA because they use it. I’‘ve tried Netbean and Eclipse. It worked on both although I needed to considerably tweek some Netbean config. On Eclipse, it’'s like a breeze. I finally settle down with Eclipse cause it suites my need.

  • Which debugger is available - Eclipse? Would I need to run it over X and connect remotely? I’'d rather use a non-graphic tool, in a terminal shell.

Assuming your Fedore Core 6 is local, don’‘t worry about the X things and remote X connection. Start your FC6 in GUI mode. FC6 complete package contains Fedora Eclipse, which is based on Eclipse 3.*. If your system doesn’‘t have that yet, install it using the FC6 package installer to have it also satisfy package dependancies. The basic installation should suffice to make Eclipse run. However you might want to change from the default GCJ version of JRE to your installed 1.5 JDK through Eclipse’'s Windows->Preference… menu.

Then check out the http://wiki.igniterealtime.org/display/WILDFIRE/Build*Openfire*with+Eclipse. If you want to try Openfire SVN source the link here could be useful.

Hope that helps.

Here is my environment:

Debian Sid (unstable) on AMD64 (also have i386 available, used to have PPC too, but not anymore)

I use both vim and kate for editors, it depends on what Im doing, each are very powerful. The Jive team uses InteliJ IDEA, and we do have an open source license available if you want to use it too. Ive found it has some stability problems on Linux AMD64, so I dont use it often.

I have 1.5.0 and 6 (JDK’'s) installed. There are times they behave differently, so its nice to be able to switch back and forth.

Ant is a must, with debian packages it dosnt seem to install too much extra cruft, but on my workstation I have a bunch of extras installed already so I may have not noticed.

Development occurs in subversion, so learning the basics of subversion is a good idea (http://svnbook.red-bean.com/ is excellent, and even printable if you want)

For debugging, much of the time just putting in appropriate logging is all that is needed. Openfire is complex with a lot of moving parts, so using a debugger can be a bit daunting at times. Ive had good luck with jdb (the Java Debugger- comes with the JDK). It works kinda like gdb, but definitely has a steep learning curve. You wont be able to see much into the internals of Java with it, unless you download the Java runtime (rt.jar) with debugging symbols enabled. This is only possible since they opensourced Java, and can be found somewhere on java.net. Its a BIG download, and not documented well- so only use it if you really need to know whats going on inside java (Ive only needed to do this a few times)

Thanks for the great replies!

This is probably out of the scope of this forum but for the benefit of future googlers:

I found the cause of my problems: Fedora 6 (and the version of Ant that comes with FC6) comes w/ the GJC (GNU java compiler) … will not install with the Sun version of the jdk (which I had previously installed) - I now have to install GNU Java or figure out how to make Ant work with the JDK from Sun.

Thanks again - Can’'t wait to finally write some OpenFire code (when I get there!) --LT

Btw, I’‘ll be running the server remotely and working thru a terminal so I won’'t be using the GUI tools. Thx

figure out how to make Ant work with the JDK from Sun.

http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/source-b uild.html

  1. Edit the “.profile” file in your home directory (or corresponding file for your shell).
  1. Set the JAVA_HOME environment variable by adding the following line to the file:
export JAVA_HOME=/usr/local/jdk1.5

The value /usr/local/jdk1.5 should be replaced with your actual Java directory. Be sure there are no spaces after the end of the directory name. Do not add an extra slash after the directory name.

  1. Save changes to the file and then “source” it:
source .profile

The JAVA_HOME variable should now be configured correctly.

I’'am working locally. For testing I copy the compiled plugin each time on the remote server.

Message was edited by: Coolcat