I have downloaded and extracted elasticsearch and when I run the batch file \"elasticsearch.bat\' I am getting the following error.
\"\\Common was unexpected at
I also encountered the same issue while running the batch file "elasticsearch.bat" in windows 10. I set JAVA_HOME using below command and it worked for me.
set "JAVA_HOME=C:\Program Files\Java\your_jdk_version"
I solved this by editing my Environment Variables - System variables - variable named CLASSPATH. The variable contained
;C:\Program Files (x86)\Common Files\EMC\ExJNIAPIGateway.jar
I quoted this
;"C:\Program Files (x86)\Common Files\EMC\ExJNIAPIGateway.jar"
Everything ran smoothly afterwards. I don't really know what corporate software that jar file relates to, but I'm not bothered if it stops working on my PC.
set "JAVA_HOME=C:\Program Files\Java\\[your_jdk_version]"
type this with your version of jdk above and retry running the bat file
I placed SET "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_191"
just under SET params='%*'
inside "bin\elasticsearch.bat"
and that made it work
@echo off
setlocal enabledelayedexpansion
setlocal enableextensions
SET params='%*'
SET "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_191"
:loop
......
Remove in path variable like C:\Program Files (x86)\Common Files\Oracle\Java\javapath
and go for it.
https://discuss.elastic.co/t/cannot-start-elasticsearch/129779/10
Set the java home it works. No need to edit elasticsearch.bat file Refer the image