The examples are distributed as source, so they must first be built. See How to Build the Examples.

Java: Running the Examples

Prerequisites

In order to run the examples, you must have Coherence version 3.4.2 or later and a Java
development kit (JDK) 1.4.2 or greater.

$COHERENCE_HOME
Make sure that the COHERENCE_HOME enviroment variable points to the location of the unpacked Coherence 3.4
(or later) directory.

$JAVA_HOME
Make sure that the JAVA_HOME environment variable points to the location of a 1.4.2 or greater JDK before
building the examples. A Java runtime 1.4.2 or greater is needed to run the examples.

Directory Structure

The directory structure described below is relative to the "examples" directory, the directory into which the examples were unzipped.

java/bin
Scripts for building and executing examples. There are two sets of scripts. Scripts with no file extension
are bash scripts. Scripts with a .cmd file extension are Windows command scripts. The following description
refers to the script names without specifying any file extension.

script name purpose
run runs an example collection
run-cache-server run the cache "server" used for examples
run-proxy run a proxy node. Optional for java examples; required for .NET and C++

resource
The data file used for the contacts LoaderExample: contacts.csv.

Instructions

Execute the run script. There are two parts to running the example.

First, start one or more cache servers: "bin/run-cache-server". Each execution will start a cache server cluster node. To add additional nodes, execute the command in a new command shell.

Second, in a new command shell, run with the name of the example such as "bin/run contacts". The Driver.main method will run through the features of the example with output going to the command window (stdout).

.NET: Running the Examples

Prerequisites

In order to run the examples, you must have Coherence version 3.4.2 or later for .NET and Visual Studio 2005 or later. To run the examples, you will also need to build the Java examples. The Java version is required because the Coherence*Extend proxy and cache servers require Java. Also, the examples depend on Java example classes that must be built before running the proxy and cache server.

Directory Structure

The directory structure described below is relative to the "examples" directory.

resource
The data file used for the contacts LoaderExample: contacts.csv.

Instructions

First, following the java instructions, start a proxy server (run-proxy) and zero or more cache servers (run-cache-server). The proxy server is storage enabled so additional cache servers are optional.

Second, from Visual Studio, choose Debug->Start without Debugging or execute the <example>.exe produced from the build in a windows command shell. The Driver.Main method will run through the features of the example with output going to the command window (stdout).

C++: Running the Examples

Prerequisites

In order to build the examples, you must have the appropriate C++ library of Coherence version 3.4 or later. Also you must have a C++ development environment. To run the examples, you will also need to build the Java examples. The Java version is required because the Coherence*Extend proxy and cache servers require Java. Also, the examples depend on Java example classes that must be built before running the proxy and cache server.

$COHERENCE_CPP_HOME
Make sure that the COHERENCE_CPP_HOME environment variable points to the location of the unpacked Coherence 3.4 C++ installation (or later) directory.

The supported C++ compilers are:

  • Windows - Microsoft Visual C++ Express/Studio 2005 or later or the equivalent Platform SDK.
  • Linux - g++ 4.0
  • Mac - g++ 4.0
  • Solaris - CC ?

Directory Structure

The directory structure described below is relative to the "examples" directory.

resource
The data file used for the contacts LoaderExample: contacts.csv.

Instructions

First, following the java instructions, start a proxy server (run-proxy) and zero or more cache servers (run-cache-server). The proxy server is storage enabled so additional cache servers are optional.

Secondly do the following:

Windows
Type bin\run.cmd contacts

Linux/Mac and Solaris
Type bin/run contacts