# Elasticsearch service won't start

**URL:** <https://discuss.elastic.co/t/elasticsearch-service-wont-start/236591>\
**Category:** Elasticsearch\
**Created:** [June 11, 2020, 12:13am UTC](https://discuss.elastic.co/t/elasticsearch-service-wont-start/236591 "2020-06-11T00:13:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckunkel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ckunkel/32/68689_2.png) [@ckunkel](https://discuss.elastic.co/u/ckunkel)\
**Post date:** [June 11, 2020, 12:13am UTC](https://discuss.elastic.co/t/elasticsearch-service-wont-start/236591/1 "2020-06-11T00:13:50Z")

</div>

I started out by installing jdk-14.0.1 and setting JAVA\_HOME environment variable to C:\Program Files\Java\jdk-14.0.1

elasticsearch-service install worked, but the service won't start. Logs say

[2020-06-10 03:10:14] [info] [3800] Starting service...  
[2020-06-10 03:10:14] [error] [4676] CreateJavaVM Failed  
[2020-06-10 03:10:14] [error] [4676] The system cannot find the file specified.  
[2020-06-10 03:10:14] [error] [3800] Failed to start Java  
[2020-06-10 03:10:14] [error] [3800] ServiceStart returned 4  
[2020-06-10 03:10:14] [info] [6136] Run service finished.

wrong version of Java maybe?

I installed JRE 8 to C:\Program Files\Java\jre1.8.0\_251 and set JAVA\_HOME to that. still no luck.

Downloaded it again but this time it put it C:\Program Files (x86)\Java\jre1.8.0\_251 . changed environment variables and tried again. Same results.

Removed JAVA\_HOME hoping it would just use the JRE that comes with elasticsearch in the elasticsearch-7.7.1\jdk directory. same results.

Set JAVA\_HOME to e:\ELK\elasticsearch-7.7.1\jdk and tried again. Same results.

I closed and re-opened the command prompt between each one of these and double checked echo %JAVA\_HOME% to make sure it was set right. I haven't tweaked any other java options and am running everything from a clean version of elasticsearch-7.7.1 with no changes to the config files or anything.

I've gotten elasticsearch service installed just FINE without any of these problems on 2 other windows 10 machines. This one is Windows Server 2019. I can't imagine that's why it's failing. Does anyone have any recommendations? I REALLY need this to be installed like yesterday.

---

<div class="post-metadata">

**Author:** ![Coinology](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Coinology](https://discuss.elastic.co/u/Coinology)\
**Post date:** [June 11, 2020, 1:11am UTC](https://discuss.elastic.co/t/elasticsearch-service-wont-start/236591/2 "2020-06-11T01:11:40Z")

</div>

@ckunkel Do you have `JAVA_HOME` set as a system or user environment variable? If it is a user variable, try to make it system instead.

EDIT: If this applies to you, you probably should reinstall the service after setting `JAVA_HOME` since you switched between JRE/JDK.

---

<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 9, 2020, 1:21am UTC](https://discuss.elastic.co/t/elasticsearch-service-wont-start/236591/3 "2020-07-09T01:21:10Z")

</div>

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