Product SiteDocumentation Site

1.2.4. Configuring (and Setting the JBOSS_HOME Environment Variable)

1.2.4.1. Setting the JBOSS_HOME Environment Variable

The JBoss Communications Platform (JBCP) is built on top of the JBoss Enterprise Application Platform (JBoss EAP). You do not need to set the JBOSS_HOME environment variable to run any of the JBoss Communications Platform servers unless JBOSS_HOME is already set.
The best way to know for sure whether JBOSS_HOME was set previously or not is to perform a simple check which may save you time and frustration.
Checking to See If JBOSS_HOME is Set on Linux
At the command line, echo$JBOSS_HOME to see if it is currently defined in your environment:
~]$ echo $JBOSS_HOME
Silence on the command line (a completely blank line) means that it is not set, in which case you can proceed with running the JBoss Communications Platform.
Checking to See if JBOSS_HOME is Set on Windows
For information on determining whether environment variables are set in recent versions of Windows, refer to http://support.microsoft.com/kb/931715.
If JBOSS_HOME is already set on your system, then you have three options:
  1. unset it, which only takes effect for the current session and is therefore not advised;
  2. find where JBOSS_HOME is defined, such as in your local ~/.bashrc startup script in Linux, or, possibly, system-wide in /etc/bashrc, and remove it or comment it out;
  3. or point it to the correct location, in which case you should refer to the following instructions on how to set JBOSS_HOME.
Setting the JBOSS_HOME Environment Variable on Linux
The JBOSS_HOME environment variable must point to the directory which contains all of the files for the JBoss Communications Platform that you installed. As another hint, this topmost directory contains a bin subdirectory.
Setting JBOSS_HOME in your personal ~/.bashrc startup script carries the advantage of retaining effect over reboots. Each time you log in, the environment variable is sure to be set for you, as a user. On Linux, it is possible to set JBOSS_HOME as a system-wide environment variable, by defining it in /etc/bashrc, but this method is neither recommended nor detailed in these instructions.
Procedure 1.5. To Set JBOSS_HOME on Linux...
  1. Open the ~/.bashrc startup script, which is a hidden file in your home directory, in a text editor, and insert the following line on its own line while substituting for the actual install location on your system:
    export JBOSS_HOME="/home/<username>/<path>/<to>/<install_directory>"
    
  2. Save and close the .bashrc startup script.
  3. You should source the .bashrc script to force your change to take effect, so that JBOSS_HOME becomes set for the current session[2].
    ~]$ source ~/.bashrc
    
  4. Finally, ensure that JBOSS_HOME is set in the current session, and actually points to the correct location:

    Note

    The command line usage below is based upon a binary installation of the JBoss Communications Platform. In this sample output, JBOSS_HOME has been set correctly to the topmost_directory of the JBCP installation. Note that if you are installing one of the standalone JBCP servers (with JBoss AS bundled!), then JBOSS_HOME would point to the topmost_directory of your server installation.
    ~]$ echo $JBOSS_HOME
    /home/silas/jboss-eap-4.3/jboss-as
    
Setting the JBOSS_HOME Environment Variable on Windows
The JBOSS_HOME environment variable must point to the directory which contains all of the files for the JBoss Communications Platform that you installed. As another hint, this topmost directory contains a bin subdirectory.
For information on how to set environment variables in recent versions of Windows, refer to http://support.microsoft.com/kb/931715.


[2] Note that any other terminals which were opened prior to your having altered .bashrc will need to source~/.bashrc as well should they require access to JBOSS_HOME.