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

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

book

Article ID: 294231

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

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.


Environment


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 the 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.

Resolution

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 


Additional Information