# Problem starting elasticsearch: "\\Common not expected"

**URL:** https://discuss.elastic.co/t/problem-starting-elasticsearch-common-not-expected/132826
**Category:** Elasticsearch
**Created:** [May 22, 2018, 1:02pm UTC](https://discuss.elastic.co/t/problem-starting-elasticsearch-common-not-expected/132826 "2018-05-22T13:02:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Samuele\_Colmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuele_colmi/32/31472_2.png) [@Samuele\_Colmi](https://discuss.elastic.co/u/Samuele_Colmi)
#### Post date: [May 22, 2018, 1:02pm UTC](https://discuss.elastic.co/t/problem-starting-elasticsearch-common-not-expected/132826/1 "2018-05-22T13:02:31Z")

</div>

Hello,  
I just installed elasticsearch and logstash on a Windows 10 (Java 1.8). The problem occourses when i try to run elasticsearch from terminal with: bin\elasticsearch.bat  
it returns "\Common not expected".  
i was following the official tutorial "getting started with elasticsearch" and I managed to install the 'x-pack' plugin but i can't run elasticsearch.  
Does anyone have any ideas?

---

<div class="post-metadata">

### Author: ![KCScott](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@KCScott](https://discuss.elastic.co/u/KCScott)
#### Post date: [May 23, 2018, 7:15pm UTC](https://discuss.elastic.co/t/problem-starting-elasticsearch-common-not-expected/132826/2 "2018-05-23T19:15:11Z")

</div>

We started having the same issue sometime in the last few releases of the JRE. The root cause seems to be the elasticsearch.bat files not handling spaces in paths when executing the java.exe to set the JVM options. I am trying to find a fix for the .bat file, but not having much luck. Another developer on our team said he added the java.exe location to his PATH environment variable, as a work around.

---

<div class="post-metadata">

### Author: ![KCScott](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@KCScott](https://discuss.elastic.co/u/KCScott)
#### Post date: [May 23, 2018, 7:50pm UTC](https://discuss.elastic.co/t/problem-starting-elasticsearch-common-not-expected/132826/3 "2018-05-23T19:50:53Z")

</div>

It turns out the root cause is actually related to how the elasticsearch.bat tries to use FOR to set the options and that command not handling parenthesis in the command. The 32-bit java.exe path, with (x86) in the path, is set first. The elasticsearch-env.bat will use the first resolved PATH for java.exe and the calling elasticsearch.bat FOR does not handle the mentioned parenthesis in that path. The two workarounds we have found are to re-order your PATH environment variable so that the x64 bit version comes first or set JAVA\_HOME to the JRE folder where the bin folder exists e.g. C:\Program Files\Java\jre1.8.0\_171

---

<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: [June 20, 2018, 7:51pm UTC](https://discuss.elastic.co/t/problem-starting-elasticsearch-common-not-expected/132826/4 "2018-06-20T19:51:13Z")

</div>

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