Cant get Elasticsearch to start on first install

Doing an initial install of ES on a windows virtual machine. Have installed latest version of java jdk on c drive, and did the zip install of ES on the E drive.
When i try to run the elasticsearch.bat file i get this:
E:\elasticsearch\elasticsearch-6.6.0>.\bin\elasticsearch.bat
E:\elasticsearch\elasticsearch-6.6.0\config\jvm.options
'""C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class ${ES_TMPDIR}=E:\ProgramData\Elastic\Elasticsearch\TMPDIRES_JAVA_OPTS

This is being ran from a priveleged account (admin),. Environment variables are:
ES_HOME=E:\elasticsearch\elasticsearch-6.6.0
ES_JAVA_OPTS=E:\ProgramData\Elastic\Elasticsearch\TMPDIR
ES_PATH_CONF=E:\elasticsearch\elasticsearch-6.6.0\config
ES_TMPDIR=E:\ProgramData\Elastic\Elasticsearch\TMPDIR
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_201

any suggestions? It appears that this is an environmental issue, but i dont know what to change at this point.
Michael Sanders

I'd recommend moving Java in a dir which does not contain any space in its name. Not Program Files or use the other name of this dir. If I recall correctly my windows days, it was something like Progra~1 but unsure.

Par of this problem with this may be that when java is installed, the installer puts a piece of code in C:\Program Files (x86)\Common Files\Oracle\Java\javapath and its not apparent that i can change that on the install. Along those same lines, is 64 bit java ok, or should i only use 32 bit or does it matter?
Finally, just as a fyi, this is on a windows 2016 server.

I don't think that 32bits is supported.

So, i am using the 64 bit version of java. Upon looking at the elasticsearch.bat file, i'm getting the following output
E:\elasticsearch\elasticsearch-6.6.0\config\jvm.options (ES_JVM_OPTIONS)
E:\elasticsearch\elasticsearch-6.6.0\lib* (ES_CLASSPATH)
"C:\Program Files\Java\jdk1.8.0_201\bin\java.exe" (JAVA)

I have defined the variable of ES_TMPDIR to "E:\ProgramData\elastic\elasticsearch\tmpdir"
yet, when it runs i now get the following error:

Error: Could not find or load main class E:\ProgramData\Elastic\Elasticsearch\TMPDIR
what's not clear is why the batch file is trying to now access TMPDIR, as i dont see the ES_TMPDIR being used. Should i not have set/defined the varialbe ES_TMPDIR?

I don't know. I'd just follow exactly the installation guide.

Ive have followed the install guide for both the zip version and the msi. IT seems that it keeps coming back to a loop in the elasticsearch.bat file where its trying do a java compile with a specific class.
Again, are there specific environment variables that need to be set beforehand?

We can close this. I resolved the issues.

Could you tell what it was?

Not 100% sure, as i changed quite a lot of things at the last minute, but i think
a) java jdk has to be installed on the C drive (although my server people dont like that). Oracle puts an addition on the path variable, that points to "C", and as i'm not asked if i want that in the install, i think it has something todo with trying to find all the pieces.
b) somewhere, i had created an environment variable, and it was getting munged by one of your .bat files. By deleting the variable, i got a different set of issues, but these then dealt with the java compiler.
Now, at the end of the day, i got it to work by using the .zip file approach. We are going to install this on another test machine, using your msi and see if we find any differences/issues.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.