Setting Up the Product Examples
Setting Up the Product Examples
The GemFire examples are included in the distribution file that contains your GemFire software. Set up your environment to run these examples as described in this section.
After you download Pivotal GemFire, you can run the examples to explore GemFire's feature set and evaluate the software.
Prerequisites
- Install GemFire on each physical or virtual machine on which you will run the Pivotal GemFire examples as described in Installing Pivotal GemFire.
- Set your JAVA_HOME, PATH, GEMFIRE, and GF_JAVA environment variables as
follows:
- Configure the JAVA_HOME environment
variable.
JAVA_HOME=/usr/java/jdk1.7.0_72 export JAVA_HOME
- Add GemFire scripts to your the PATH environment variable. For
example:
PATH=$PATH:$JAVA_HOME/bin:/opt/pivotal/Pivotal_GemFire_820_b17919_Linux/bin export PATH
- Set the GEMFIRE environment
variable to point to your GemFire installation top-level directory. (You
should see bin, lib,
dtd, and other directories under GEMFIRE.) The
following variables definitions are examples; your installation path may
vary depending on where you install GemFire and the version you are
installing.
GEMFIRE=/opt/pivotal/Pivotal_GemFire_820_b17919_Linux export GEMFIRE
- Configure your GF_JAVA
environment variables as shown in these examples. GF_JAVA must point to
the java executable file under your JAVA_HOME. (If you
have not done so already, you should also set your JAVA_HOME variable to
a supported Java installation.)
GF_JAVA=$JAVA_HOME/bin/java export GF_JAVA
- Configure the JAVA_HOME environment
variable.
Examples Included with Pivotal GemFire
The following examples are included in the SampleCode directory from your GemFire product download.
Example | Example Code Location | Documentation Location |
---|---|---|
Hello World
A simple demonstration of GemFire data distribution. |
SampleCode/helloworld | Pivotal GemFire User's Guide: Hello World Example |
Pivotal GemFire Tutorial
A guided tour of Pivotal GemFire's core features. |
SampleCode/tutorial | Pivotal GemFire User's Guide: Pivotal GemFire Tutorial |
QuickStart Examples
Demonstrates the following GemFire features:
|
SampleCode/quickstart | Pivotal GemFire User's Guide:QuickStart Examples |
Programming Examples
The following examples demonstrate how to write applications using the Pivotal GemFire Java API:
|
SampleCode/examples/dist |
Documentation for the Programming Examples is available in the following files in the SampleCode directory of your GemFire download: Examples guide: SampleCode/examples/ README_dist_index.html (Each example subdirectory contains a README.html file with the documentaiton for that example.) Examples Javadocs: SampleCode/examples/dist/ javadocs/index.html |
OSGi Examples
The following examples demonstrate how to deploy GemFire applications into an OSGi environment:
|
SampleCode/examples/osgi |
SampleCode/examples/ osgi/dist/README.html |
- Run through the Pivotal GemFire Tutorial. See Pivotal GemFire Tutorial.
- Explore GemFire configuration files and application code. See Hello World Example.
- Run the examples. See QuickStart Examples.