Skip to content

Restore quotes around module detection JAVA_HOME#6638

Merged
headius merged 1 commit intojruby:jruby-9.2from
headius:quotes
Mar 30, 2021
Merged

Restore quotes around module detection JAVA_HOME#6638
headius merged 1 commit intojruby:jruby-9.2from
headius:quotes

Conversation

@headius
Copy link
Member

@headius headius commented Mar 30, 2021

See #6615 (review)

The quoting around $JAVA_HOME was inadvertently removed while fixing module detection in #6615. The review linked above points out that this causes problems when the JDK is installed in a path with spaces. This is not common on unixy environments, and the bash script is not used on Windows where it is more common, but the regression is real.

This PR restores the quoting around $JAVA_HOME to fix the issue.

@headius headius added this to the JRuby 9.2.18.0 milestone Mar 30, 2021
@headius headius merged commit e9f99f5 into jruby:jruby-9.2 Mar 30, 2021
@headius headius deleted the quotes branch March 30, 2021 16:47
@headius
Copy link
Member Author

headius commented Mar 30, 2021

According to @walro in #6615 (comment) the affected path with spaces is where Oracle JDK 8 installed on MacOS (/Library/Internet Something). This differs from where my system installs, in /LIbrary/Java/JavaVirtualMachines and may indicate a new layout for JDKs in newer MacOS releases.

I have asked for more information.

@walro
Copy link

walro commented Mar 30, 2021

Thanks!

I noticed this since I, for reasons I do not remember now, had my $JAVA_HOME pointing at /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home. It's the "JRE path" of Oracle's Java installation, see for example:

@walro
Copy link

walro commented Mar 30, 2021

indicate a new layout for JDKs in newer MacOS releases.

I think it has been like this "forever", I might just be odd favoring a JRE installation (I generally don't do any Java development) ;-)

@headius
Copy link
Member Author

headius commented Mar 30, 2021

@walro Aha that explains it! We should run fine with a JRE so that is no problem, but I did not realize that the Oracle JRE gets installed in a path with spaces (and referencing the long-deprecated Applet feature, no less!)

I will look into adding a test for this situation, at least when on MacOS and such a path is available.

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.

2 participants