# 0.90.5 - service.bat terminates unexpectedly

**URL:** <https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669>\
**Category:** Elasticsearch\
**Created:** [September 18, 2013, 12:57pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669 "2013-09-18T12:57:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Carpenter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_carpenter/32/2093_2.png) [@Mark\_Carpenter](https://discuss.elastic.co/u/Mark_Carpenter)\
**Post date:** [September 18, 2013, 12:57pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/1 "2013-09-18T12:57:36Z")

</div>

When trying to install Elasticsearch as a service using the provided batch  
script, it terminates without giving any console output. When  
double-clicked in Windows explorer, the command window appears and exits  
immediately. When run from a command window, nothing happens.

Removing '@echo off' from service.bat and trying again yields the following:

C:\elasticsearch-0.90.5\bin\>SETLOCAL  
C:\elasticsearch-0.90.5\bin\>if NOT DEFINED JAVA\_HOME goto err  
C:\elasticsearch-0.90.5\bin\>set SCRIPT\_DIR=C:\elasticsearch-0.90.5\bin\  
C:\elasticsearch-0.90.5\bin\>for %I in ("C:\elasticsearch-0.90.5\bin..") do  
set ES\_HOME=%~dpfI  
C:\elasticsearch-0.90.5\bin\>set ES\_HOME=C:\elasticsearch-0.90.5  
C:\elasticsearch-0.90.5\bin\>rem Detect JVM version to figure out  
appropriate executable to use  
C:\elasticsearch-0.90.5\bin\>C:\Program Files\Java\jre7\bin\java -version  
2\>&1 | find "64-Bit" 1\>nul:

I am able to run elasticsearch.bat without any problem - I can index,  
search, and discover other nodes.

Other useful info:

- Elasticsearch Version 0.90.5
- Windows Server 2012 Datacenter x64 (Hosted in Azure)
- JRE 1.7.0\_40-b43

Any ideas?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [September 18, 2013, 1:35pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/2 "2013-09-18T13:35:05Z")

</div>

Looks like the spaces in the java definition break the version detection - adding quotes around it should help (I'll fix  
this shortly in trunk and 0.90).  
In the meantime you could either add the quotes yourself or use a symlink without spaces:

> mklink /D /J "c:\jvm" "c:\Program Files\Java"

By the way, note that you are using a JRE not the JDK which means Elasticsearch will run in client mode only.

Cheers,

On 18/09/2013 3:57 PM, Mark Carpenter wrote:

> When trying to install Elasticsearch as a service using the provided batch script, it terminates without giving any  
> console output. When double-clicked in Windows explorer, the command window appears and exits immediately. When run from  
> a command window, nothing happens.
> 
> Removing '@echo off' from service.bat and trying again yields the following:
> 
> ```
> C:\elasticsearch-0.90.5\bin>SETLOCAL
> C:\elasticsearch-0.90.5\bin>if NOT DEFINED JAVA_HOME goto err
> C:\elasticsearch-0.90.5\bin>set SCRIPT_DIR=C:\elasticsearch-0.90.5\bin\
> C:\elasticsearch-0.90.5\bin>for %I in ("C:\elasticsearch-0.90.5\bin\..") do set ES_HOME=%~dpfI
> C:\elasticsearch-0.90.5\bin>set ES_HOME=C:\elasticsearch-0.90.5
> C:\elasticsearch-0.90.5\bin>rem Detect JVM version to figure out appropriate executable to use
> C:\elasticsearch-0.90.5\bin>C:\Program Files\Java\jre7\bin\java -version 2>&1 | find "64-Bit" 1>nul:
> 
> ```
> 
> I am able to run elasticsearch.bat without any problem - I can index, search, and discover other nodes.
> 
> Other useful info:
> 
> - Elasticsearch Version 0.90.5
> - Windows Server 2012 Datacenter x64 (Hosted in Azure)
> - JRE 1.7.0\_40-b43
> 
> Any ideas?
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [September 18, 2013, 2:38pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/3 "2013-09-18T14:38:14Z")

</div>

I've pushed a fix for your issue in 0.90 and master:

> <https://github.com/elastic/elasticsearch/issues/3725>
>
> The detection of Java version fails if \`JAVA\_HOME\` contains spaces. In turn, thi…s causes the \`service.bat\` to exit without any message.

It would be great if you could test it out.

Thanks,

On 18/09/2013 3:57 PM, Mark Carpenter wrote:

> When trying to install Elasticsearch as a service using the provided batch script, it terminates without giving any  
> console output. When double-clicked in Windows explorer, the command window appears and exits immediately. When run from  
> a command window, nothing happens.
> 
> Removing '@echo off' from service.bat and trying again yields the following:
> 
> ```
> C:\elasticsearch-0.90.5\bin>SETLOCAL
> C:\elasticsearch-0.90.5\bin>if NOT DEFINED JAVA_HOME goto err
> C:\elasticsearch-0.90.5\bin>set SCRIPT_DIR=C:\elasticsearch-0.90.5\bin\
> C:\elasticsearch-0.90.5\bin>for %I in ("C:\elasticsearch-0.90.5\bin\..") do set ES_HOME=%~dpfI
> C:\elasticsearch-0.90.5\bin>set ES_HOME=C:\elasticsearch-0.90.5
> C:\elasticsearch-0.90.5\bin>rem Detect JVM version to figure out appropriate executable to use
> C:\elasticsearch-0.90.5\bin>C:\Program Files\Java\jre7\bin\java -version 2>&1 | find "64-Bit" 1>nul:
> 
> ```
> 
> I am able to run elasticsearch.bat without any problem - I can index, search, and discover other nodes.
> 
> Other useful info:
> 
> - Elasticsearch Version 0.90.5
> - Windows Server 2012 Datacenter x64 (Hosted in Azure)
> - JRE 1.7.0\_40-b43
> 
> Any ideas?
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Caio\_D\_Angelo](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@Caio\_D\_Angelo](https://discuss.elastic.co/u/Caio_D_Angelo)\
**Post date:** [September 18, 2013, 7:53pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/4 "2013-09-18T19:53:55Z")

</div>

I tested and the proposed solution works fine.

Thanks.

Em quarta-feira, 18 de setembro de 2013 11h38min14s UTC-3, Costin Leau  
escreveu:

> I've pushed a fix for your issue in 0.90 and master:  
> [service.bat fails unexpectedly if JAVA\_HOME contains spaces · Issue #3725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3725)
> 
> It would be great if you could test it out.
> 
> Thanks,
> 
> On 18/09/2013 3:57 PM, Mark Carpenter wrote:
> 
> > When trying to install Elasticsearch as a service using the provided  
> > batch script, it terminates without giving any  
> > console output. When double-clicked in Windows explorer, the command  
> > window appears and exits immediately. When run from  
> > a command window, nothing happens.
> > 
> > Removing '@echo off' from service.bat and trying again yields the  
> > following:
> > 
> > ```
> > C:\elasticsearch-0.90.5\bin>SETLOCAL 
> > C:\elasticsearch-0.90.5\bin>if NOT DEFINED JAVA_HOME goto err 
> > C:\elasticsearch-0.90.5\bin>set 
> > 
> > ```
> 
> SCRIPT\_DIR=C:\elasticsearch-0.90.5\bin\
> 
> > ```
> > C:\elasticsearch-0.90.5\bin>for %I in 
> > 
> > ```
> 
> ("C:\elasticsearch-0.90.5\bin..") do set ES\_HOME=%~dpfI
> 
> > ```
> > C:\elasticsearch-0.90.5\bin>set ES_HOME=C:\elasticsearch-0.90.5 
> > C:\elasticsearch-0.90.5\bin>rem Detect JVM version to figure out 
> > 
> > ```
> 
> appropriate executable to use
> 
> > ```
> > C:\elasticsearch-0.90.5\bin>C:\Program Files\Java\jre7\bin\java 
> > 
> > ```
> 
> -version 2\>&1 | find "64-Bit" 1\>nul:
> 
> > I am able to run elasticsearch.bat without any problem - I can index,  
> > search, and discover other nodes.
> > 
> > Other useful info:
> > 
> > - Elasticsearch Version 0.90.5
> > - Windows Server 2012 Datacenter x64 (Hosted in Azure)
> > - JRE 1.7.0\_40-b43
> > 
> > Any ideas?
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to  
> > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [September 18, 2013, 7:57pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/5 "2013-09-18T19:57:00Z")

</div>

Thanks for the quick feedback and sorry for the inconvenience.

Cheers,

On 18/09/2013 10:53 PM, Caio D'Angelo wrote:

> I tested and the proposed solution works fine.
> 
> Thanks.
> 
> Em quarta-feira, 18 de setembro de 2013 11h38min14s UTC-3, Costin Leau escreveu:
> 
> ```
> I've pushed a fix for your issue in 0.90 and master:
> https://github.com/elasticsearch/elasticsearch/issues/3725 <https://github.com/elasticsearch/elasticsearch/issues/3725>
> 
> It would be great if you could test it out.
> 
> Thanks,
> 
> On 18/09/2013 3:57 PM, Mark Carpenter wrote:
> > When trying to install Elasticsearch as a service using the provided batch script, it terminates without giving any
> > console output. When double-clicked in Windows explorer, the command window appears and exits immediately. When run from
> > a command window, nothing happens.
> >
> > Removing '@echo off' from service.bat and trying again yields the following:
> >
> > C:\elasticsearch-0.90.5\bin>SETLOCAL
> > C:\elasticsearch-0.90.5\bin>if NOT DEFINED JAVA_HOME goto err
> > C:\elasticsearch-0.90.5\bin>set SCRIPT_DIR=C:\elasticsearch-0.90.5\bin\
> > C:\elasticsearch-0.90.5\bin>for %I in ("C:\elasticsearch-0.90.5\bin\..") do set ES_HOME=%~dpfI
> > C:\elasticsearch-0.90.5\bin>set ES_HOME=C:\elasticsearch-0.90.5
> > C:\elasticsearch-0.90.5\bin>rem Detect JVM version to figure out appropriate executable to use
> > C:\elasticsearch-0.90.5\bin>C:\Program Files\Java\jre7\bin\java -version 2>&1 | find "64-Bit" 1>nul:
> >
> > I am able to run elasticsearch.bat without any problem - I can index, search, and discover other nodes.
> >
> > Other useful info:
> >
> > * Elasticsearch Version 0.90.5
> > * Windows Server 2012 Datacenter x64 (Hosted in Azure)
> > * JRE 1.7.0_40-b43
> >
> > Any ideas?
> >
> > --
> > You received this message because you are subscribed to the Google Groups "elasticsearch" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to
> >elasticsearc...@googlegroups.com <javascript:>.
> > For more options, visithttps://groups.google.com/groups/opt_out <https://groups.google.com/groups/opt_out>.
> 
> --
> Costin
> 
> ```
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mark\_Carpenter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_carpenter/32/2093_2.png) [@Mark\_Carpenter](https://discuss.elastic.co/u/Mark_Carpenter)\
**Post date:** [September 19, 2013, 12:46pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/6 "2013-09-19T12:46:49Z")

</div>

Costin,

Thanks for the quick feedback! I finally got some time to revisit this, and  
your suggestion to use a path without spaces worked great! Instead of  
adding quotes or creating a symlink, I changed the JAVA\_HOME environment  
variable to _C:\Progra~1\Java\jdk...._ Also, leaving it pointed at the JRE  
path caused starting the service to fail (couldn't find jvm.dll, according  
to the error logs), so I switched it to the JDK path.

In any event, you've been very helpful - thank you!

-Mark

On Wednesday, September 18, 2013 3:57:00 PM UTC-4, Costin Leau wrote:

> Thanks for the quick feedback and sorry for the inconvenience.
> 
> Cheers,
> 
> On 18/09/2013 10:53 PM, Caio D'Angelo wrote:
> 
> > I tested and the proposed solution works fine.
> > 
> > Thanks.
> > 
> > Em quarta-feira, 18 de setembro de 2013 11h38min14s UTC-3, Costin Leau  
> > escreveu:
> > 
> > ```
> > I've pushed a fix for your issue in 0.90 and master: 
> > https://github.com/elasticsearch/elasticsearch/issues/3725 <
> > 
> > ```
> 
> [service.bat fails unexpectedly if JAVA\_HOME contains spaces · Issue #3725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3725)\>
> 
> > ```
> > It would be great if you could test it out. 
> > 
> > Thanks, 
> > 
> > On 18/09/2013 3:57 PM, Mark Carpenter wrote: 
> > > When trying to install Elasticsearch as a service using the 
> > 
> > ```
> 
> provided batch script, it terminates without giving any
> 
> > ```
> > > console output. When double-clicked in Windows explorer, the 
> > 
> > ```
> 
> command window appears and exits immediately. When run from
> 
> > ```
> > > a command window, nothing happens. 
> > > 
> > > Removing '@echo off' from service.bat and trying again yields the 
> > 
> > ```
> 
> following:
> 
> > ```
> > > 
> > > C:\elasticsearch-0.90.5\bin>SETLOCAL 
> > > C:\elasticsearch-0.90.5\bin>if NOT DEFINED JAVA_HOME goto err 
> > > C:\elasticsearch-0.90.5\bin>set 
> > 
> > ```
> 
> SCRIPT\_DIR=C:\elasticsearch-0.90.5\bin\
> 
> > ```
> > > C:\elasticsearch-0.90.5\bin>for %I in 
> > 
> > ```
> 
> ("C:\elasticsearch-0.90.5\bin..") do set ES\_HOME=%~dpfI
> 
> > ```
> > > C:\elasticsearch-0.90.5\bin>set 
> > 
> > ```
> 
> ES\_HOME=C:\elasticsearch-0.90.5
> 
> > ```
> > > C:\elasticsearch-0.90.5\bin>rem Detect JVM version to figure 
> > 
> > ```
> 
> out appropriate executable to use
> 
> > ```
> > > C:\elasticsearch-0.90.5\bin>C:\Program 
> > 
> > ```
> 
> Files\Java\jre7\bin\java -version 2\>&1 | find "64-Bit" 1\>nul:
> 
> > ```
> > > 
> > > I am able to run elasticsearch.bat without any problem - I can 
> > 
> > ```
> 
> index, search, and discover other nodes.
> 
> > ```
> > > 
> > > Other useful info: 
> > > 
> > > * Elasticsearch Version 0.90.5 
> > > * Windows Server 2012 Datacenter x64 (Hosted in Azure) 
> > > * JRE 1.7.0_40-b43 
> > > 
> > > Any ideas? 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > 
> > ```
> 
> Groups "elasticsearch" group.
> 
> > ```
> > > To unsubscribe from this group and stop receiving emails from it, 
> > 
> > ```
> 
> send an email to
> 
> > ```
> > >elasticsearc...@googlegroups.com <javascript:>. 
> > > For more options, visithttps://groups.google.com/groups/opt_out <
> > 
> > ```
> 
> [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)\>.
> 
> > ```
> > -- 
> > Costin 
> > 
> > ```
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to  
> > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [September 19, 2013, 2:38pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/7 "2013-09-19T14:38:11Z")

</div>

Glad to hear it worked. I've added another improvement to service.bat to allow ES to run under JRE (this means using a  
client JVM so service.bat gives you a warning) but also to do some basic JAVA\_HOME detection in case the path is invalid.  
This should prevent some issues when using incorrect settings and make the script more reliable.

The fix is available in both master and 0.90 branch [1]. Feedback is welcome!

Cheers,

[1] [service.bat should handle JRE not just JDK for starting Elasticsearch · Issue #3739 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3739)

On 19/09/2013 3:46 PM, Mark Carpenter wrote:

> Costin,
> 
> Thanks for the quick feedback! I finally got some time to revisit this, and your suggestion to use a path without spaces  
> worked great! Instead of adding quotes or creating a symlink, I changed the JAVA\_HOME environment variable to  
> _C:\Progra~1\Java\jdk...._ Also, leaving it pointed at the JRE path caused starting the service to fail (couldn't find  
> jvm.dll, according to the error logs), so I switched it to the JDK path.
> 
> In any event, you've been very helpful - thank you!
> 
> -Mark
> 
> On Wednesday, September 18, 2013 3:57:00 PM UTC-4, Costin Leau wrote:
> 
> ```
> Thanks for the quick feedback and sorry for the inconvenience.
> 
> Cheers,
> 
> On 18/09/2013 10:53 PM, Caio D'Angelo wrote:
> > I tested and the proposed solution works fine.
> >
> > Thanks.
> >
> > Em quarta-feira, 18 de setembro de 2013 11h38min14s UTC-3, Costin Leau escreveu:
> >
> > I've pushed a fix for your issue in 0.90 and master:
> >https://github.com/elasticsearch/elasticsearch/issues/3725
> <https://github.com/elasticsearch/elasticsearch/issues/3725>
> <https://github.com/elasticsearch/elasticsearch/issues/3725
> <https://github.com/elasticsearch/elasticsearch/issues/3725>>
> >
> > It would be great if you could test it out.
> >
> > Thanks,
> >
> > On 18/09/2013 3:57 PM, Mark Carpenter wrote:
> > > When trying to install Elasticsearch as a service using the provided batch script, it terminates without giving any
> > > console output. When double-clicked in Windows explorer, the command window appears and exits immediately. When run from
> > > a command window, nothing happens.
> > >
> > > Removing '@echo off' from service.bat and trying again yields the following:
> > >
> > > C:\elasticsearch-0.90.5\bin>SETLOCAL
> > > C:\elasticsearch-0.90.5\bin>if NOT DEFINED JAVA_HOME goto err
> > > C:\elasticsearch-0.90.5\bin>set SCRIPT_DIR=C:\elasticsearch-0.90.5\bin\
> > > C:\elasticsearch-0.90.5\bin>for %I in ("C:\elasticsearch-0.90.5\bin\..") do set ES_HOME=%~dpfI
> > > C:\elasticsearch-0.90.5\bin>set ES_HOME=C:\elasticsearch-0.90.5
> > > C:\elasticsearch-0.90.5\bin>rem Detect JVM version to figure out appropriate executable to use
> > > C:\elasticsearch-0.90.5\bin>C:\Program Files\Java\jre7\bin\java -version 2>&1 | find "64-Bit" 1>nul:
> > >
> > > I am able to run elasticsearch.bat without any problem - I can index, search, and discover other nodes.
> > >
> > > Other useful info:
> > >
> > > * Elasticsearch Version 0.90.5
> > > * Windows Server 2012 Datacenter x64 (Hosted in Azure)
> > > * JRE 1.7.0_40-b43
> > >
> > > Any ideas?
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "elasticsearch" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to
> > >elasticsearc...@googlegroups.com <javascript:>.
> > > For more options, visithttps://groups.google.com/groups/opt_out <http://groups.google.com/groups/opt_out> <https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>>.
> >
> > --
> > Costin
> >
> > --
> > You received this message because you are subscribed to the Google Groups "elasticsearch" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to
> >elasticsearc...@googlegroups.com <javascript:>.
> > For more options, visithttps://groups.google.com/groups/opt_out <https://groups.google.com/groups/opt_out>.
> 
> --
> Costin
> 
> ```
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Hendrik](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hendrik](https://discuss.elastic.co/u/Hendrik)\
**Post date:** [October 30, 2013, 4:00pm UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/8 "2013-10-30T16:00:27Z")

</div>

you also can try this

> **[Release v0.90.5.1 (EA 0.90.5, Java 7u45) · salyh/elasticsearch-msi-installer](https://github.com/salyh/elasticsearch-msi-installer/releases/tag/v0.90.5.1)**
>
> Create your own Elasticsearch msi installer with a customized ES config that fit your needs.
> Or simply download the standard preconfigured installer (see below) that comes configured with:
> 
> 2G Heap...

Am Mittwoch, 18. September 2013 14:57:36 UTC+2 schrieb Mark Carpenter:

> When trying to install Elasticsearch as a service using the provided batch  
> script, it terminates without giving any console output. When  
> double-clicked in Windows explorer, the command window appears and exits  
> immediately. When run from a command window, nothing happens.
> 
> Removing '@echo off' from service.bat and trying again yields the  
> following:
> 
> C:\elasticsearch-0.90.5\bin\>SETLOCAL  
> C:\elasticsearch-0.90.5\bin\>if NOT DEFINED JAVA\_HOME goto err  
> C:\elasticsearch-0.90.5\bin\>set SCRIPT\_DIR=C:\elasticsearch-0.90.5\bin\   
> C:\elasticsearch-0.90.5\bin\>for %I in ("C:\elasticsearch-0.90.5\bin..")  
> do set ES\_HOME=%~dpfI  
> C:\elasticsearch-0.90.5\bin\>set ES\_HOME=C:\elasticsearch-0.90.5  
> C:\elasticsearch-0.90.5\bin\>rem Detect JVM version to figure out  
> appropriate executable to use  
> C:\elasticsearch-0.90.5\bin\>C:\Program Files\Java\jre7\bin\java -version  
> 2\>&1 | find "64-Bit" 1\>nul:
> 
> I am able to run elasticsearch.bat without any problem - I can index,  
> search, and discover other nodes.
> 
> Other useful info:
> 
> - Elasticsearch Version 0.90.5
> - Windows Server 2012 Datacenter x64 (Hosted in Azure)
> - JRE 1.7.0\_40-b43
> 
> Any ideas?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:09am UTC](https://discuss.elastic.co/t/0-90-5-service-bat-terminates-unexpectedly/13669/9 "2017-07-06T02:09:45Z")

</div>


