-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Fix bat scripts to work with JAVA_HOME containing special characters #38965
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
Conversation
Pinging @elastic/es-core-infra |
ok to test |
This: bin\elasticsearch-plugin install file:///C:/bla/ingest-attachment-6.6.0.zip still throws an error: \Common was unexpected at this time. |
@csetzkorn thank you for this - will indeed increase the scope of this PR to include fixes to all windows bat scripts using to JAVA_HOME with '(' or ' ' |
@csetzkorn can you please confirm that you had the failure you mentioned after applying the patch from this PR? |
@elasticmachine run elasticsearch-ci/packaging |
e3d136f
to
cc33dc3
Compare
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 & parans). 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)
cc33dc3
to
14cd39f
Compare
closing as cannot resolve the conflicts after the base change (seems to be a github bug) |
the
elasticsearch.bat
andelasticsearch-env.bat
won't work ifJAVA
contains parentheses. This seems to be the limitation ofFOR /F IN (command) DO
syntax.The
JAVA
variable present in a command contains a path to a binary to start elasticsearch (with spaces & parans). We can workaround the problem of spaces and parentheses in this path by referring this variable with aCALL
command.Note that executing binaries with
CALL
is an undocumented behaviour (but works)closes #38578
closes #38624
closes #33405
closes #30606