Elasticsearch service won't start

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.

@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.

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