Skip to content

Use java_home command on MacOS#6731

Merged
headius merged 1 commit intojruby:jruby-9.2from
headius:macos_java_home
Jun 30, 2021
Merged

Use java_home command on MacOS#6731
headius merged 1 commit intojruby:jruby-9.2from
headius:macos_java_home

Conversation

@headius
Copy link
Member

@headius headius commented 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 #6726.

The same change needs to go into jruby-launcher.

@headius headius added this to the JRuby 9.2.20.0 milestone Jun 30, 2021
@headius headius changed the base branch from master to jruby-9.2 June 30, 2021 19:33
headius added a commit to headius/jruby-launcher that referenced this pull request 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.
@headius headius merged commit 625e22f into jruby:jruby-9.2 Jun 30, 2021
@headius headius deleted the macos_java_home branch June 30, 2021 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open3 with no JAVA_OPTS fails silently

1 participant