Use java_home command on MacOS#6731
Merged
headius merged 1 commit intojruby:jruby-9.2from Jun 30, 2021
Merged
Conversation
headius
added a commit
to headius/jruby-launcher
that referenced
this pull request
Jun 30, 2021
This was referenced Jun 30, 2021
headius
added a commit
to headius/jruby-launcher
that referenced
this pull request
Jun 30, 2021
When no JAVA_HOME env is set on MacOS, we do not properly detect the actual JDK install location. The default `java` command is an executable in /usr/bin/java that launches the default installed JDK (usually the highest version). Since it is not a simlink the logic we use on Linux to dig out the real JAVA_HOME does not work. This patch uses the `java_home` command when no JAVA_HOME is set. This command is only available on MacOS as far as I know, though similar commands exist on other platforms. Fixes jruby#6726. The same change needs to go into jruby-launcher.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When no JAVA_HOME env is set on MacOS, we do not properly detect
the actual JDK install location. The default
javacommand is anexecutable in /usr/bin/java that launches the default installed
JDK (usually the highest version). Since it is not a simlink the
logic we use on Linux to dig out the real JAVA_HOME does not work.
This patch uses the
java_homecommand when no JAVA_HOME is set.This command is only available on MacOS as far as I know, though
similar commands exist on other platforms.
Fixes #6726.
The same change needs to go into jruby-launcher.