# Cant get Elasticsearch to start on first install

**URL:** <https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208>\
**Category:** Elasticsearch\
**Created:** [February 27, 2019, 4:42pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208 "2019-02-27T16:42:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrsanders](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mrsanders](https://discuss.elastic.co/u/mrsanders)\
**Post date:** [February 27, 2019, 4:42pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/1 "2019-02-27T16:42:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 27, 2019, 5:02pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/2 "2019-02-27T17:02:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mrsanders](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mrsanders](https://discuss.elastic.co/u/mrsanders)\
**Post date:** [February 27, 2019, 6:27pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/3 "2019-02-27T18:27:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 27, 2019, 7:28pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/4 "2019-02-27T19:28:21Z")

</div>

I don't think that 32bits is supported.

---

<div class="post-metadata">

**Author:** ![mrsanders](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mrsanders](https://discuss.elastic.co/u/mrsanders)\
**Post date:** [February 27, 2019, 8:06pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/5 "2019-02-27T20:06:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 27, 2019, 10:11pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/6 "2019-02-27T22:11:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mrsanders](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mrsanders](https://discuss.elastic.co/u/mrsanders)\
**Post date:** [February 27, 2019, 11:27pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/7 "2019-02-27T23:27:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mrsanders](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mrsanders](https://discuss.elastic.co/u/mrsanders)\
**Post date:** [February 28, 2019, 12:13am UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/8 "2019-02-28T00:13:36Z")

</div>

We can close this. I resolved the issues.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 28, 2019, 6:20am UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/9 "2019-02-28T06:20:28Z")

</div>

Could you tell what it was?

---

<div class="post-metadata">

**Author:** ![mrsanders](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mrsanders](https://discuss.elastic.co/u/mrsanders)\
**Post date:** [February 28, 2019, 8:08pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/10 "2019-02-28T20:08:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 28, 2019, 8:08pm UTC](https://discuss.elastic.co/t/cant-get-elasticsearch-to-start-on-first-install/170208/11 "2019-03-28T20:08:54Z")

</div>

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