I am trying to start up a locator using gfsh and I keep getting that a main class cannot be found.
I am running this: gfsh start locator --name=locator1
After this I get the following error:
Error: Could not find or load main class com.gemstone.gemfire.distributed.LocatorLauncher
Which to me this means that something is missing on the classpath to find that jar. I have these on my classpath:
export JAVA_HOME=/Java/jdk1.8.0_111
export GEMFIRE=/Pivotal_GemFire_822
export GF_JAVA=$JAVA_HOME/bin/java
(I abbreviated the paths)
The setup docs also say you need tools.jar included w the JDK on your classpath. I did that and it didn't make any difference. I thought that would be included on JAVA_HOME anyways.
A few things...
Pivotal_GemFire_822
install in "root" (?) is a complete, full distribution (i.e. downloaded form Pivotal's Network... PivNet)?The
com.gemstone.gemfire.distributed.LocatorLauncher
class is contained in the$GEMFIRE/lib/gemfire.jar
. Make sure thegemfire.jar
exists and that you can find this class in the JAR file (usingjar -tvf $GEMFIRE/lib/gemfire.jar | less
then search (:
) for "LocatorLauncher
").$ echo $GEMFIRE
If you do NOT see any value returned then you need to source the shell file containing the export, e.g.
$source ~/.bash_profile
.Make sure your file system permissions to your GemFire installation are set appropriately. If you have GemFire 8.2.2. install under your home directory (
/home/<user>
) then this should not be a problem.As for the JDK
tools.jar
. This is not included on the classpath by default. The old Apple JDK 6 (which is no longer supported by Apple) included the tools.jar classes on the Apple JVM classpath, but regular Sun/Oracle JDKs do not. Also note, the JRE does not have the tools.jar in the distribution, unlike the JDK. However, it is also not strictly required as of GemFire 8.1 or 8.2, technically.If all the above is true, then you should be able to start a Locator without incident. Please check these things and let us know if you still continue to have problems.
For real detailed technical information on what the Gfsh script does before the shell starts as well as what it does to launch a Locator, see this and this.
Hope this helps.
-John