Setting Classpath

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: JARs that should be in the classpath of applications accessing a remote or embedded space.

This page is specific to:
GigaSpaces 5.x

If you're interested in another version, click it below:
GigaSpaces 6.0
[GigaSpaces 6.5]

Libraries

GigaSpaces libraries located at <GigaSpaces Root>\lib folder:

You may find the space runtime library at <GigaSpaces Root>\lib\JSpaces.jar and 3rd party libraries located at sub-folders under <GigaSpaces Root>\lib.

Client Classpath

When a client application accessing GigaSpaces running in a remote mode the client should have the following jars as part of its classpath:
<GigaSpaces Root>\lib\JSpaces.jar
<GigaSpaces Root>\lib\jini\jsk-platform.jar
<GigaSpaces Root>\lib\jini\jsk-lib.jar

java -cp c:\GigaSpacesEE5.0\lib\JSpaces.jar com.j_spaces.examples.hellospace.
HelloWorld jini://localhost/*/mySpace?groups=myGroup
Jars shouldn't be located in directories that contain a space as part of their names. For example, do not place GigaSpaces jars under the C:\Documents and Settings or its sub-folders.
As a workaround you may specify the classpath using: C:\Docume~1.

Server Classpath

An application running GigaSpaces in embedded mode should set the following libraries and directories as part of its classpath.
<GigaSpaces Root>\jini\jsk-platform.jar
<GigaSpaces Root>\jini\jsk-lib.jar
<GigaSpaces Root>\jini\start.jar
<GigaSpaces Root>\rio\webster.jar
<GigaSpaces Root>\rio\boot.jar
<GigaSpaces Root>\log4j\log4j.jar

To simplify the classpath configuration, JSpaces.jar contains the above list as part of its manifest file. As of JDK 1.5, you can include only the main JAR,(JSpaces.jar), and the compiler or JVM finds the rest of the libraries through the manifest classpath entry.

In the example below, only JSpaces.jar is added to the classpath. The rest of the libraries are located implicitly by the JVM.

If you want to copy the libraries to your own environment, you must maintain the directory structure of the libraries as listed above. The full classpath definition for running GigaSpaces is provided in the GigaSpaces setenv under the GS_JARS environment variable. You can call the setenv shell that is provided as part of the GigaSpaces/bin directory from your application script and use the GS_JARS variable as = part of your classpath.

If you are using JDK 1.5, you need the following JARs as part of your classpath:
For windows: %JSHOMEDIR%\lib\JSpaces.jar
For Unix: ${JSHOMED= IR}/lib/JSpaces.jar

Where the GS_JARS environment variable.

For Windows:
call %JSHOMEDIR%\bin\setenv
echo GigaSpaces Classpath= %GS_JARS}

For Unix:
source ${JSHOMEDIR}/bin/setenv.sh
echo GigaSpaces Classpath= ${GS_JARS}

Classpath Environment Variable Description
JSHOMEDIR Optional - Points to the location of the schema files. The schema files are searched under the config/schemas package under the location of that directory. In cases where it is required to point to a different schema's configuration directory, it should be placed before or instead of this directory.
EXT_JARS Optional - Points to all jars under the lib/ext directory. It is normally used for setting up patches. It is required that it will appear before JSPaces.jar so that the patch will be able to overwrite existing classes.
JDBC_JARS Optional - contains the drivers for the JDBC; normally this is required in persistent space mode.
JSHOMEDIR/lib/JSpaces.jar Required - GigaSpaces classes

Adding Libraries to the GigaSpaces Server Classpath

Sometimes a patch must be installed or new libraries included as part of the GigaSpaces server system classpath. To simplify the installation, perform these updates without changing the existing configuration files. For this purpose, GigaSpaces maintains the lib/ext directory. Each JAR installed in this directory is automatically included as part of the GigaSpaces classpath. You can use the LCP environment variable as a reference to this directory.


Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels

 
(None)