-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows elasticsearch.bat file has problems with certains paths #30606
Comments
Pinging @elastic/es-core-infra |
I found #28753 which might be related but that should have been fixed in 6.2.3. Not sure if this is a different issue. |
I had the same issue in windows |
@sathiql JAVA_HOME is assigned, the problem is with the parentheses in the path. Does your path contain parentheses? |
My Windows 10 with java SE x64 version 1.8.0_171-b11 running Elasticsearch 6.2.4 also had this problem |
Thanks, @Dobatymo for the fix! It works in general, but the result will be that only first option from jvm.options file will be picked up. Here is the updated version (with added delims= option) that picks all JVM options:
|
Still the same issue in v6.3.0 Another issue that is in the elasticsearch.bat is just 2 lines above "for /F". It starts with set "ES_JVM_OPTIONS=
|
This is reproducible in Windows Server 2016 when |
I've resolved this with the below two steps on Windows 10 - 64 bit machine using Command Line Installer for ElasticSearch 6.4.2
with
it worked like a charm for me... PS:
|
the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA contains parentheses. This seems to be the limitation of FOR /F IN (command) DO syntax. The JAVA variable present in a command contains a path to a binary to start elasticsearch (with spaces & parens). We can workaround the problem of spaces and parentheses in this path by referring this variable with a CALL command. Note that executing binaries with CALL is an undocumented behaviour (but works) closes #38578 closes #38624 closes #33405 closes #30606
…39712) the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA contains parentheses. This seems to be the limitation of FOR /F IN (command) DO syntax. The JAVA variable present in a command contains a path to a binary to start elasticsearch (with spaces & parens). We can workaround the problem of spaces and parentheses in this path by referring this variable with a CALL command. Note that executing binaries with CALL is an undocumented behaviour (but works) closes elastic#38578 closes elastic#38624 closes elastic#33405 closes elastic#30606
the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA contains parentheses. This seems to be the limitation of FOR /F IN (command) DO syntax. The JAVA variable present in a command contains a path to a binary to start elasticsearch (with spaces & parens). We can workaround the problem of spaces and parentheses in this path by referring this variable with a CALL command. Note that executing binaries with CALL is an undocumented behaviour (but works) closes elastic#38578 closes elastic#38624 closes elastic#33405 closes elastic#30606
the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA contains parentheses. This seems to be the limitation of FOR /F IN (command) DO syntax. The JAVA variable present in a command contains a path to a binary to start elasticsearch (with spaces & parens). We can workaround the problem of spaces and parentheses in this path by referring this variable with a CALL command. Note that executing binaries with CALL is an undocumented behaviour (but works) closes elastic#38578 closes elastic#38624 closes elastic#33405 closes elastic#30606
…40768) the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA contains parentheses. This seems to be the limitation of FOR /F IN (command) DO syntax. The JAVA variable present in a command contains a path to a binary to start elasticsearch (with spaces & parens). We can workaround the problem of spaces and parentheses in this path by referring this variable with a CALL command. Note that executing binaries with CALL is an undocumented behaviour (but works) closes #38578 closes #38624 closes #33405 closes #30606 backports: * Bat scripts to work with JAVA_HOME with parentheses(#39712) * Link to SYSTEM_JAVA_HOME on windows (#40806)
Hi All,
if your java is installed under C:\Program Files then set the JAVA_HOME like will below After that try to start the elastic search, it should start then. Thanks & Regards |
the elasticsearch.bat and elasticsearch-env.bat won't work if JAVA contains parentheses. This seems to be the limitation of FOR /F IN (command) DO syntax. The JAVA variable present in a command contains a path to a binary to start elasticsearch (with spaces & parens). We can workaround the problem of spaces and parentheses in this path by referring this variable with a CALL command. Note that executing binaries with CALL is an undocumented behaviour (but works) closes elastic#38578 closes elastic#38624 closes elastic#33405 closes elastic#30606
I did the same but it won't work |
after hours my conclusion of those whose elasticsearch.bat file not opening
Do these you elasticsearch.bat file not opening will be solved. |
Very late to the party but I would add some more comments for someone that might be here in the future:
just my 2cents |
Bug report:
Elasticsearch version: 6.2.4
Plugins installed: None
JVM version: 1.8.0_171
OS version: Windows 10 (1511)
Description of the problem including expected versus actual behavior:
I cannot start elastic search using
elasticsearch.bat
.The error message is:
\Common was unexpected at this time.
Fix
%JAVA% is assigned
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
inelasticsearch-env.bat
.This breaks the last for loop in
elasticsearch.bat
. This can be fixed be changing it tofor /F "usebackq" %%a in (`CALL %JAVA% -cp "!ES_CLASSPATH!" "org.elasticsearch.tools.launchers.JvmOptionsParser" "!ES_JVM_OPTIONS!" ^|^| echo jvm_options_parser_failed`) do set JVM_OPTIONS=%%a
See also https://stackoverflow.com/a/30139757/
The text was updated successfully, but these errors were encountered: