I have at least two versions of Java on server so JAVA_HOME points to version 8 not 11.
To start manually start ES I just modified elasticsearch-env.bat:
if "%JAVA_HOME%" == "" (
set JAVA="%ES_HOME%\jdk\bin\java.exe"
set JAVA_HOME="%ES_HOME%\jdk"
set JAVA_TYPE=bundled jdk
) else (
set JAVA="C:\Program Files\Java\jdk-11.0.6\bin\java.exe"
set JAVA_TYPE=JAVA_HOME
)
But I cannot make it work for elasticsearch-service.bat
I modified several lines including '--Jvm' paramter but still does not work.
I tried set JAVA_HOME by adding line set "JAVA_HOME=C:\Program Files\Java\jdk-11.0.6" but it dost not work.
What should I modify to make it works?