Pivotal Knowledge Base

Follow

How to set multiple paths in the CLASSPATH using the --classpath option for "gfsh start server" on Windows

Environment

Product Version
Pivotal GemFire tested on 8.2.1.1
OS Windows platform

Purpose

This article explains how to include multiple paths in the CLASSPATH using the --classpath option to the gfsh start server command on Windows when using gfsh in interactive mode.

Cause

Suppose that you execute the gfsh start server command intending to include multiple paths to the CLASSPATH using the --classpath option as in the following:

gfsh> start server --name=cache1 ...(snip)... --classpath=C:\path\to\lib1.jar;C:\path\to\lib2.jar

Although this will start the server, only first path is set in the CLASSPATH (in this case, only the path to lib1.jar) and gfsh will give the following message:

Command "C:\path\to\lib2.jar" is not valid.

On Windows systems, the semicolon (;) is used as a delimiter sign for java class paths. The issue is that it is also recognized as a delimiter sign for gfsh commands. Hence, gfsh reads the semicolon in the CLASSPATH as a terminator for the start server command and anything following as a new command.

Procedure

In order to include multiple paths using the --classpath option in gfsh on a Windows system, you will need to escape any semicolons with a backslash (\) as in the following example:

gfsh> start server --name=cache1 ...(snip)... --classpath=C:\path\to\lib1.jar\;C:\path\to\lib2.jar

 

Comments

Powered by Zendesk