GemStone® GemFire Enterprise®
Environment Settings for Programming Examples

Before running the programming examples, make sure your environment is set according to the specifications listed here.

The general environment settings referred to below are documented in the Programming with GemFire Enterprise chapter of the GemFire Enterprise Developer's Guide. The commands and settings listed are generally Unix-centric, so adjust as necessary for other operating systems.

  1. Temporarily disable your firewall while you are running the examples. This ensures that the examples will perform as expected.

  2. Change directory to the top-level GemFire product directory. If you are in the top-level product directory, you should see a number of subdirectories, including bin, defaultConfigs, docs, examples, lib, and quickstart. Refer to the GemFire Enterprise Developer's Guide if you need help with this step.

  3. Set the environment variable GF_JAVA to point to the JAVA executable in your Java JDK or JRE runtime environment. The GF_JAVA setting is for the GemFire scripts. You must have a compatible JDK or JRE installed on your system and you must set GF_JAVA to point to the JAVA executable in it. You can download the appropriate JDK or JRE from

    These are example GF_JAVA configurations. In these examples, yourJRE or yourJDK points to the top-level JRE or JDK directory.

    Solaris®, Linux®, and AIX® Bourne and Korn shells (sh, ksh, bash)

    If just the JRE runtime is installed: GF_JAVA=yourJRE/bin/java;export GF_JAVA

    If the full Java JDK is installed: GF_JAVA=yourJDK/jre/bin/java;export GF_JAVA


    If just the JRE runtime is installed: set GF_JAVA=yourJRE/bin/java.exe

    If the full Java JDK is installed: set GF_JAVA=yourJDK/jre/bin/java.exe

    See the Product Installation chapter of the GemFire Enterprise System Administrator's Guide for details.

  4. Add <Path to GemFire product dir>/bin to your PATH.

  5. Add <Path to GemFire product dir>/examples/dist/classes to your CLASSPATH.
    For example, this could be C:\GemFireXX/examples/dist/classes, where GemFireXX is the GemFire top-level product directory.

  6. Add <Path to GemFire product dir>/lib/gemfire.jar to the CLASSPATH.

  7. Add <Path to GemFire product dir>/lib/antlr.jar to the CLASSPATH.

  8. If you are running the GemFire JMX examples that use JMX APIs (healthMonitor example), add both of these to CLASSPATH:
    <Path to GemFire product dir>/lib/mx4j.jar
    <Path to GemFire product dir>/lib/mx4j-remote.jar

  9. If you are running the security exercises in the clientServerConfigs example, include this setting:
    Add <Path to GemFire product dir>/lib/gfSecurityImpl.jar to CLASSPATH.