Unable to start Elasticsearch in Windows10

I have downloaded 7.6.2 and 7.5.0 .zip versions of ES and unzipped them. When I run '.\bin\elasticsearch.bat', it throws error 'The system cannot open the device or file specified'. I have set the JAVA_HOME to the JRE path excluding the '\bin' in System variables. Yet, the same error.
Also tried 7.6.2 using MSI and it threw different error 'Could not find or load main class Warning:'.
Please help me!

Both 7.6.2 and 7.5.0 come with a bundled JDK. Can you try

  1. removing the JAVA_HOME environment variable
  2. running .\bin\elasticsearch.bat again

In the absence of a JAVA_HOME environment variable, Elasticsearch will use the bundled JDK

Did what you said. Still getting the same message. Tried opening cmd as admin and running the command. Same message.

Would you be able to copy the exact error message that you get? Would you also be able to provide more details about your Windows environment e.g. architecture, RAM, etc. What is returned when running


This is the error message I'm getting:

The system cannot open the device or file specified.

Removed certain infos because this is laptop provided at workplace:

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.17134 N/A Build 17134
System Manufacturer:       HP
System Model:              HP ZBook 15 G3
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 94 Stepping 3 GenuineIntel ~2712 Mhz
BIOS Version:              HP N81 Ver. 01.45, 1/6/2020
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
Total Physical Memory:     16,264 MB
Available Physical Memory: 11,046 MB
Virtual Memory: Max Size:  17,288 MB
Virtual Memory: Available: 11,322 MB
Virtual Memory: In Use:    5,966 MB
Page File Location(s):     C:\pagefile.sys

What is returned if you run the following in a PowerShell command prompt


Nothing returned.

Ok. Is there anything in C:\ElasticSearch\elasticsearch-7.5.0\logs? If so, what's in the elasticsearch.log?

The logs folder is empty.

Hmm...I'm not sure what the issue is here. It appears to be an issue occurring before Elasticsearch starts, somewhere in the batch scripts. From a brief search, this error message, or a similar one was related to JAVA_HOME env var being set incorrectly, but since it appears to be empty here, it should be using the bundled JDK.

Is there anything in the Windows event logs that looks pertinent?

No entry related to this in Application and System Event logs.

Where does the TMP environment variable point to i.e. what does


in PowerShell return?

It may be an issue in accessing the temp directory. We can see if this is the case by explicitly setting the ES_TMPDIR environment variable to a location that we know will be accessible, before calling .\bin\elasticsearch.bat again. Can you try that?

I did what you said. In addition to that, there was this protection software whose protection I removed for all the files within ES bin. Now, I do not get old error, but a new one Access Denied.

It worked when I removed the protection for all the files under ES. :))

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