Running GigaSpaces IDE Examples
Overview
This section explains how to use the sample code that has been provided with the GigaSpaces package.
-
The example sources are located at
$GS_HOME/examples
. -
The example .jar file is located at
$GS_HOME/examples/jars
.
Building the Examples
Building the examples is not required, since the package includes a pre-built .jar file. However, if you want to modify the examples for learning purposes and rebuild them, follow this procedure.
Before the first time building the examples, you need to install the GigaSpaces artifacts in your local Maven repository. To do that, run the following from the $GS_HOME/bin/
directory:
gs.{sh/bat} maven install
Next, use the following command in Maven to build the examples from $GS_HOME/examples
:
mvn clean package
The end result is an examples .jar located at $GS_HOME/examples/target/examples.jar
.
Running the Examples
In order to run the examples on your local machine you need to start a local GigaSpaces environment. If you haven't done so already, refer to Starting GigaSpaces on a Local Service Grid for more info.
You can run the GigaSpaces example .jar from any of the following:
-
IDE
Using an IDE
You can run the examples from your preferred IDE. Every example has a main
method, so it can be executed as standard application. Note these two important configuration requirements:
-
Enable
run-from-ide
in the Maven profile. This will switch the required dependencies tocompile
scope, so they are available in the classpath. -
Pass the examples as
local[*]
anddemo
arguments.