Skip to content

Make Windows JAVA_HOME handling consistent with Linux#55261

Merged
rjernst merged 3 commits intoelastic:masterfrom
rjernst:windows_nojava
Apr 16, 2020
Merged

Make Windows JAVA_HOME handling consistent with Linux#55261
rjernst merged 3 commits intoelastic:masterfrom
rjernst:windows_nojava

Conversation

@rjernst
Copy link
Copy Markdown
Member

@rjernst rjernst commented Apr 15, 2020

In bash, checking for whether an env variable exists uses the -z test,
against a stringified env var, so that the test is actually whether the
env var is empty, but not necessarily undefined. We use this to test
whether JAVA_HOME is set, to determine whether the bundled jdk should be
used. In windows, this test is an actual "undefined" check. This commit
brings the behavior on two systems in sync, opting to allow for an empty
JAVA_HOME in windows to indicate the bundled jdk should be used.

closes #55134

In bash, checking for whether an env variable exists uses the -z test,
against a stringified env var, so that the test is actually whether the
env var is empty, but not necessarily undefined. We use this to test
whether JAVA_HOME is set, to determine whether the bundled jdk should be
used. In windows, this test is an actual "undefined" check. This commit
brings the behavior on two systems in sync, opting to allow for an empty
JAVA_HOME in windows to indicate the bundled jdk should be used.

closes elastic#55134
@rjernst rjernst added >enhancement :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v8.0.0 v7.8.0 labels Apr 15, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Packaging)


public void test54ForceBundledJdkEmptyJavaHome() throws Exception {
assumeThat(distribution().hasJdk, is(true));
// cleanup from previous test
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not spark joy.

@rjernst rjernst merged commit f686bdc into elastic:master Apr 16, 2020
@rjernst rjernst deleted the windows_nojava branch April 16, 2020 22:25
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 16, 2020
In bash, checking for whether an env variable exists uses the -z test,
against a stringified env var, so that the test is actually whether the
env var is empty, but not necessarily undefined. We use this to test
whether JAVA_HOME is set, to determine whether the bundled jdk should be
used. In windows, this test is an actual "undefined" check. This commit
brings the behavior on two systems in sync, opting to allow for an empty
JAVA_HOME in windows to indicate the bundled jdk should be used.

closes elastic#55134
rjernst added a commit that referenced this pull request Apr 16, 2020
In bash, checking for whether an env variable exists uses the -z test,
against a stringified env var, so that the test is actually whether the
env var is empty, but not necessarily undefined. We use this to test
whether JAVA_HOME is set, to determine whether the bundled jdk should be
used. In windows, this test is an actual "undefined" check. This commit
brings the behavior on two systems in sync, opting to allow for an empty
JAVA_HOME in windows to indicate the bundled jdk should be used.

closes #55134
@pugnascotia pugnascotia changed the title Make windows JAVA_HOME handling consistent with linux Make Windows JAVA_HOME handling consistent with Linux May 14, 2020
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts >enhancement Team:Delivery Meta label for Delivery team v7.8.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Startup option that would ignore any system JVM

5 participants