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.
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.
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.
Now, comes the most exciting part. In this section, we will setup openfire with IntelliJ IDEA.
Steps:
- Download Openfire Source code and extract into Openfire folder (https://www.igniterealtime.org/projects/openfire/index.jsp)
- Open IntelliJ IDEA > Import Project > Browse to Openfire > Create project from existing resources
- Project name: Openfire, verify Project location > Next
- Here, IntelliJ shows us all the sources directory it found in Openfire source, leave them all checked > Next
- On this step, it combines Openfire plugin library into individual lib, leave them all checked > Next
- 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
- 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
Openfire uses Apache Ant to build server source code and and plugins
- 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)
- Click +(Add) > Browse Build.xml from Openfire/build/build.xml > OK
- Expand All > Double click on openfire to build
- Now, you will find two more folders target and work in your Openfire folder
- To run Openfire, you will find
openfire.sh
oropenfire.exe
executable file in yourOpenfire/target/openfire/bin/openfire.sh
folder. 6.) Open Terminal, iTerm2, cmd and run executable according to your OS