REQ: Guide To Hacking Jive Messenger

Would someone be generous enough to write up a short Guide To Hacking Jive Messenger? I know my way around automake/autoconf/gcc/perl/python/ruby/etc, but I’‘m a complete ignoramus when it comes to modern Java build systems (ant/eclipse/etc). I mostly just want to know how to build JM so I can hack up some function, build, and test. Whether that is with something as grand as Eclipse or simply just an ant command, I don’'t really care – I just want to tinker with a few things.

10 points are on the line here, people!

Hi hrothgar,

Below are two different routes you can take. I tried to keep the directions somewhat generic since I wasn’‘t sure what platform you’'re using.

Basic Tools

Step 1:

url=http://java.sun.com/j2se/index.jspDownload[/url] and url=http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.htmlinstall[/url] the J2SE 5.0. Note, that the install guide I linked to is for 1.4.2 but it works just as well for 1.5/5.0.

Step 2:

url=http://ant.apache.org/bindownload.cgiDownload[/url] and url=http://ant.apache.org/manual/installlist.htmlinstall[/url] Ant.

Step 3:

url=http://www.jivesoftware.org/source.jspDownload[/url] or check out from cvs the Messenger source.

Step 4:

Open up a command prompt and navigate to build directory in whatever directory you have the Messenger source in. Type ‘‘ant’’ and assuming that you installed the jdk and ant properly you’'ll get a full build of Messenger. There are various targets within the ant build script that you can specify by typing '‘ant ‘’, typically you’'ll just stick to using ‘‘ant jar’’ and ‘‘ant plugins’’.

Eclipse

Step 1:

url=http://java.sun.com/j2se/index.jspDownload[/url] and url=http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.htmlinstall[/url] the J2SE 5.0. Note, that the install guide I linked to is for 1.4.2 but they work just as well for 1.5/5.0.

Step 2:

url=http://www.jivesoftware.org/source.jspDownload[/url] or check out from cvs the Messenger source.

Step 3:

Download the latest url=http://download.eclipse.org/downloads/drops/S-3.1M5a-200502191500/index.phpversion[/url] of Eclipse and extract it. (Eclipse 3.1x is still in beta but it has support for J2SE 5.0 and is generally very stable)

Step 4:

a. Start up Eclipse.

b. Dismiss the Welcome screen by clicking on the arrow in the upper right hand corner.

c. Go to Window -> Open Perspective -> Java

d. Go to Window -> Show View -> Ant

e. Go to Window -> Show View -> Package Explorer (this may be open by default, I can’'t remember)

f. In the Package Explorer window right-click, select New -> Project. Make sure the Java Project option is selected and click on the “Next” button. Enter a name in the project name field and then click on the “Create project at external location” radio button, use the “Browse” button to point Eclipse to the directory you extracted the Messenger source to, then click on the “Next” button. If all goes well (fingers crossed ), Eclipse will figure out all the libraries that Messenger needs as well as where all the various .java files are stored, click on the “Finish” button.

g. In the Ant window right-click, select Add Buildfile, and then in the dialog that appears expand the tree to show the build directory, when you do that you should see the build.xml file double-click on it and the dialog will go away.

h. Now, in the Ant window you can expand the “Messenger XMPP Server” entry and see all the various targets. To run any of the targets simply double-click on it.

I’'ve probably left out a thing or two, so if you have any question please let me know.

Hope that helps,

Ryan

Thanks, Ryan. I followed your Eclipse notes, and everything is working great. Plus, you’'re 10 geek points richer.

Plus, you’'re 10 geek points richer.

Yeah! Geek points! My precious…

Hi!

Quick note:

If you also still have JDK 1.4 installed and you get an ant error like “invalid source release”, goto Windows->Preferences…->Ant->Runtime->Global Entries. If there exists still tools.jar reference from 1.4, delete it and add the 5.0 tools.jar.

Happend to me.

Jörg

For the sake of completeness, here’‘s a guide on how to install Netbeans to work with Jive Messenger. I’'m doing some of this out of the top of my head, so correct me if I go wrong.

Step 1

Download the latest Netbeans IDE (currently 4.1) from url=http://www.netbeans.org/downloads/index.htmlthis page[/url]. If you don’‘t have J2SE 5.0 installed (or if you’‘re unsure), you can download a Netbeans Bundled with J2SE 5.0 from that same page (currently, you would need the ‘‘NetBeans IDE 4.1 with J2SE 5.0 Update 5 Bundle’’ link, but that’‘ll change in the future). Install it like you’'d do with any other application.

Step 2

url=http://www.jivesoftware.org/source.jspDownload[/url] or check out from cvs the Messenger source.

Step 3

Start Netbeans (and close any welcome-screens).

Start a new project by Going to ‘‘File’’ -> ‘‘New Project…’’ This will give you a new dialog screen.

In that screen, select from the ‘‘General’’ category a projecttype called ‘‘Java Project with Existing Ant Script’’ and press ‘‘Next >’’.

In the next dialog, in the ‘‘Location’’ textbox, select the folder in which you checked out the Messenger source in step 2.

In the second textbox (’‘Build Script’’), select the build file that comes with the source. It called ‘‘build.xml’’ and lives in the ‘‘build’’ directory of the sources.

Optionally, change the other settings in that dialog (Project Name, etc). After that, press ‘‘Next >’’ again.

In the last dialog, you’'re asked to specify Ant targets for common menu items. Make them match this:

Build Project: compile

Clean Project: clean

Generate Javadoc: javadoc

Run Project: run

Test Project: test

Hit ‘‘Finish’’ and you should be ready to go.

Hi, I used Ryans way for eclipse but if i try to build the whole messanger with

ant i just get the message below. I used google but didn’‘t really know what i’'ve to search for …

For me as a java beginner there is nothing usefull in this error message ?!

BUILD FAILED

C:\jive_messenger_src\build\build.xml:383: The following error occurred while executing this line:

C:\jive_messenger_src\build\build.xml:395: Javadoc failed: java.io.IOException: CreateProcess: javadoc.exe -d C:\jive_messenger_src\target\javadoc -windowtitle “Jive Messenger 2.2.2 Javadoc” -overview C:\jive_messenger_src\src\java\overview.html -doctitle “Jive Messenger 2.2.2 Javadoc” -header “Jive Messenger 2.2.2 Javadoc” -bottom “Copyright © 1999-2004 Jive Software.” -classpath C:\jive_messenger_src\build\lib\ant-contrib.jar;C:\jive_messenger_src\build\lib \ant-subdirtask.jar;C:\jive_messenger_src\build\lib\ant.jar;C:\jive_messenger_sr c\build\lib\commons-el.jar;C:\jive_messenger_src\build\lib\jasper-compiler.jar;C :\jive_messenger_src\build\lib\jasper-runtime.jar;C:\jive_messenger_src\build\li b\xmltask.jar;C:\jive_messenger_src\build\lib\merge\commons-logging.jar;C:\jive_ messenger_src\build\lib\merge\dom4j.jar;C:\jive_messenger_src\build\lib\merge\ja xen.jar;C:\jive_messenger_src\build\lib\merge\jdic.jar;C:\jive_messenger_src\bui ld\lib\merge\jetty.jar;C:\jive_messenger_src\build\lib\merge\jmdns.jar;C:\jive_m essenger_src\bu”

I had to strip the HTML-tags from the error message

Message was edited by:

Galeon

Never worked with Eclipse, but is seems you haven’'t got javadoc installed or linked. Ryan can help you out there, probably.

What ant target were you trying to run? One that doesn’‘t try to create the javadocs might still succeed - I’‘m just not sure which targets do or don’'t create javadocs. Try the ant jar target, see what that gets you.

Hi Galeon,

That’‘s an error I haven’‘t seen before. I would guess there is something that isn’‘t configured properly in Eclipse. If you don’'t already have ant installed outside of Eclipse I would install it, and then try running the “ant javadoc” target and see if you get the same error.

As for continuing to use Eclipse, try following Guus advice and use the “ant jar” target and see if you have the same problem.

Hope that helps,

Ryan

Thanks for your help @both

I’‘ve realized that the everything is build perfectly only the javadoc is missing, that’'s ok for me ;).

So, i’'ll try now to feed the jive-server with my plugin hope