Skip to content
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

[macOS] Zulu install in /Library/Java/JavaVirtualMachines fails when java_macos_integration_enable = yes #137

Closed
delgurth opened this issue Mar 15, 2021 · 1 comment · Fixed by #138

Comments

@delgurth
Copy link
Contributor

After enabling

java_macos_integration_enable = yes

It seems the location for the MacOS folder and Info.plist files for Zulu is not working as expected:

$ asdf install java zulu-8.52.0.23
...
Integrating with /usr/libexec/java_home needs root permission for it to create folders under /Library/Java/JavaVirtualMachines
cp: /Users/<username>/.asdf/Contents/MacOS: No such file or directory
cp: /Users/<username>/.asdf/Contents/Info.plist: No such file or directory

Which results in the MacOS java_home command being unable to find the installed runtime:

$ /usr/libexec/java_home -V
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

Installing for example Adopt OpenJDK I'm getting the expected results:

$ asdf install java adoptopenjdk-15.0.2+7
...
Integrating with /usr/libexec/java_home needs root permission for it to create folders under /Library/Java/JavaVirtualMachines

And then

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (1):
    15.0.2 (x86_64) "AdoptOpenJDK" - "OpenJDK 15.0.2" /Library/Java/JavaVirtualMachines/adoptopenjdk-15.0.2+7/Contents/Home
/Library/Java/JavaVirtualMachines/adoptopenjdk-15.0.2+7/Contents/Home

The problem resides in the usage of absolute_dir_path combined with a file (release) and not a directory.

Changing release into bin/.. fixes it for me.

$ asdf install java zulu-11.45.27
Integrating with /usr/libexec/java_home needs root permission for it to create folders under /Library/Java/JavaVirtualMachines
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    15.0.2 (x86_64) "AdoptOpenJDK" - "OpenJDK 15.0.2" /Library/Java/JavaVirtualMachines/adoptopenjdk-15.0.2+7/Contents/Home
    11.0.10 (x86_64) "Azul Systems, Inc." - "Zulu 11.45.27" /Library/Java/JavaVirtualMachines/zulu-11.45.27/Contents/Home
/Library/Java/JavaVirtualMachines/adoptopenjdk-15.0.2+7/Contents/Home
delgurth added a commit to delgurth/asdf-java that referenced this issue Mar 15, 2021
…ail to return the expected result. Changed it to bin/..

Fixes halcyon#137
halcyon pushed a commit that referenced this issue Apr 6, 2021
* Release is a file which results in the absolute_dir_path command to fail to return the expected result. Changed it to bin/..

Fixes #137

* Added test to validate the /usr/libexec/java_home working as expected

* Added information to the liberica install about it not being integrated in /usr/libexec/java_home

* Only run the update-data on the main repository
@paddyroddy
Copy link

Mine works now but this message

Integrating with /usr/libexec/java_home needs root permission for it to create folders under /Library/Java/JavaVirtualMachines

at first glance suggests to me it isn't

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 a pull request may close this issue.

2 participants