thakkaryash94
6/27/2018 - 4:50 PM

openfire-setup.md

Openfire is a real time collaboration (RTC) server licensed under the Open Source Apache License. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber). The Ignite Realtime Community manage and maintain Openfire releases.

This is a guide of setting up Openfire project in JAVA IDE IntelliJ IDEA.

JDK and IDE Setup:

JDK Setup:

Openfire is based on JAVA programming language, so if we want to work with source code, Java Development Kit(JDK) must be installed on our machine.

Download and install Java SE(Standard Edition) depending upoun your OS. Here is the instruction for installing JDK on Oracle Solaris, Windows, Linux, and OS X computers.

Export JDK path to your OS environment variable as JAVA_HOME

Note: Please install JDK first, otherwise IntelliJ IDEA won't work.

IntelliJ IDEA IDE Setup:

Download and install IntelliJ IDEA Community Edition respective to your OS. Click Here to setup IntelliJ IDEA on your machine. After setup, you should be able to see a start screen like below.

Setup Openfire in IntelliJ IDEA:

Now, comes the most exciting part. In this section, we will setup openfire with IntelliJ IDEA.

Steps:

  1. Download Openfire Source code and extract into Openfire folder (https://www.igniterealtime.org/projects/openfire/index.jsp)
  2. Open IntelliJ IDEA > Import Project > Browse to Openfire > Create project from existing resources
  3. Project name: Openfire, verify Project location > Next
  4. Here, IntelliJ shows us all the sources directory it found in Openfire source, leave them all checked > Next
  5. On this step, it combines Openfire plugin library into individual lib, leave them all checked > Next
  6. Now it will show us all the modules(plugins) with dependencies including libraries that module depends on (We will talk about plugin structure in next post) > Next
  7. Setup JDK path, probably 1.8 > Finish

Now, IntelliJ IDEA will load and open Openfire project, you should be able to see something like this

Build Openfire:

Openfire uses Apache Ant to build server source code and and plugins

  1. Go to Right Top Corner and click on Ant Build (If you are not able find the window border, click on bottom left icon on IDE)
  2. Click +(Add) > Browse Build.xml from Openfire/build/build.xml > OK
  3. Expand All > Double click on openfire to build
  4. Now, you will find two more folders target and work in your Openfire folder
  5. To run Openfire, you will find openfire.sh or openfire.exe executable file in your Openfire/target/openfire/bin/openfire.sh folder. 6.) Open Terminal, iTerm2, cmd and run executable according to your OS
Help Links: