This page describes an older version of the product. The latest stable version is 14.0.

Setting up your IDE


Follow the instructions in this tutorial to prepare your development environment.

Note

Ensure you have a JDK installed. You will need Java 8 or higher, latest update is recommended.

Checking your JDK Version

To check your installed Java version:

  1. Open a command line window.
  2. Run set JAVA_HOME.
  3. A response similar to this suggests you have a JDK installed:

    JAVA_HOME=C:\jdk1.8
    
  4. To check the JDK version, run %JAVA_HOME%\bin\java \-version. A response like this from Java indicates 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.

Installing a Proper JDK (Java Development Kit)

  1. To install JDK 1.6, download and install JDK 6 Update X
  2. Download and unzip the latest XAP release from the downloads page.
  3. 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.

Running the Application inside Eclipse IDE

  1. Start Eclipse. The Workspace Launcher window opens.
  2. Write a new workspace name or select one of your existing workspaces, and click OK.
  3. To import the project, select File > Import to open the Import window.
  4. Select Existing projects into workspace and click Next to open the Import Project window.
  5. In the Select root directory field, click Browse to open the browse window.
  6. Select the folder /examples/helloworld and click OK.
  7. Make sure the following 3 projects are selected: hello-common, hello-processor, and hello-feeder.
  8. Click Finish.
  9. Create a new Eclipse environment variable called GS_HOME, and point it to your GigaSpaces installation Root folder.
  10. Right click the hello-common project in the Package Explorer tab to open the context menu.
  11. Select Build Path > Configure Build Path to open the Java Build Path window.
  12. Select the Libraries tab* and click the *Add Variable… button to open the New Variable Classpath Entry dialog
  13. Click Configure Variables to open the Classpath Variables window.
  14. Click New to open the New Variable Entry window.
  15. In the Name field, write GS_HOME to name the variable.
  16. Click Folder and browse to your GigaSpaces installation root folder.
  17. Select your GigaSpaces installation root folder and click OK (3 times in total).
  18. Click Yes to do a full rebuild.
  19. Close the remaining windows.

Classpath

The XAP libraries are located under XAP_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 XAP platform.

Compilation

In order to compile and run XAP applications, all the JAR files under the XAP_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 XAP_HOME/lib/optional.

Runtime - Processing Unit

When an application is deployed as a Processing Unit, there is no need to add XAP-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.

Runtime - Standalone

When running a standalone client that accesses XAP, ensure that all the JARs located under the XAP_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 XAP runtime environment, or more specifically a GSC, you must include these JARs in your application’s WEB-INF/lib directory.

Maven

XAP is Maven-friendly. It is built using Maven, which can be easily used by developers constructing XAP applications.

The main dependency required to use XAP is xap-openspaces.

 <dependency>
   <groupId>org.gigaspaces</groupId>
   <artifactId>xap-openspaces</artifactId>
   <version>12.3.1</version>
 </dependency>

XAP 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>