Preparing Your Development Environment
Ensure you have a JDK installed. You will need Java 8 or 11; the latest update is recommended.
To check your installed Java version:
- Open a command line window.
A response similar to this suggests you have a JDK installed:
To check the JDK version, run
%JAVA_HOME%\bin\java \-version. A response like this from
Javaindicates you have a valid JDK installed:
java version "1.6.0_23" Java(TM) SE Runtime Environment (build 1.6.0_23-b05) Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
If your installed JDK version is lower then 1.5 or none is installed, see below on how to install one.
- To install a JDK, download and install JDK 6 Update X
- Download and unzip the latest GigaSpaces product release from the downloads page.
- Install a Java IDE. If you don't have an IDE installed, you can download and unzip the Eclipse IDE for Java Developers, or the IntelliJ IDEA IDE (we recommend the Ultimate Edition because of its excellent Spring framework support). If you're using Eclipse, it is also recommended to install the Spring Tool Suite plugin for Eclipse.
- Start Eclipse. The Workspace Launcher window opens.
- Write a new workspace name or select one of your existing workspaces, and click OK.
- To import the project, select File > Import to open the Import window.
- Select Existing projects into workspace and click Next to open the Import Project window.
- In the Select root directory field, click Browse to open the browse window.
- Select the folder
/examples/helloworldand click OK.
- Make sure the following 3 projects are selected: hello-common, hello-processor, and hello-feeder.
- Click Finish.
- Create a new Eclipse environment variable called GS_HOME, and point it to your GigaSpaces installation Root folder.
- Right click the hello-common project in the Package Explorer tab to open the context menu.
- Select Build Path > Configure Build Path to open the Java Build Path window.
- Select the Libraries tab* and click the *Add Variable... button to open the New Variable Classpath Entry dialog
- Click Configure Variables to open the Classpath Variables window.
- Click New to open the New Variable Entry window.
- In the Name field, write
GS_HOMEto name the variable.
- Click Folder and browse to your GigaSpaces installation root folder.
- Select your GigaSpaces installation root folder and click OK (3 times in total).
- Click Yes to do a full rebuild.
- Close the remaining windows.
The GigaSpaces libraries are located under
$GS_HOME/lib. There are three sub-directories:
lib/required- JAR files that are required for any GigaSpaces application.
lib/optional- JAR files that enable additional capabilities, such as servlet api.
lib/platform- JAR files that are used only by the GigaSpaces platform.
In order to compile and run GigaSpaces applications, all the JAR files under the
$GS_HOME/lib/required directory should be included in your compile and run time classpaths. Additional JAR files that you may need for development are located at
When an application is deployed as a Processing Unit, there is no need to add GigaSpaces-specific JAR files to the Processing Unit classpath. If such are added under the Processing Unit's
lib directory, the system will remove those JAR files and replace them with the system's JARs for compatibility.
When running a standalone client that accesses GigaSpaces, ensure that all the JARs located under the
$GS_HOME/lib/required directory are part of the JVM's classpath. This also holds true for remote Space clients that are used from another JVM (such as a standalone web container). If your client is a JEE web application that is not running within the GigaSpaces runtime environment, or more specifically a GSC, you must include these JARs in your application's
GigaSpaces is Maven-friendly. It is built using Maven, which can be easily used by developers constructing GigaSpaces applications.
The main dependency required to use GigaSpaces is
<dependency> <groupId>org.gigaspaces</groupId> <artifactId>xap-openspaces</artifactId> <version>15.2.0</version> </dependency>
GigaSpaces artifacts are currently not published in Maven Central Repo, therefore you must configure a repository:
<repository> <id>org.openspaces</id> <url>http://maven-repository.openspaces.org</url> </repository>