-
Notifications
You must be signed in to change notification settings - Fork 868
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
Self hosted agents does not detect java capability for OpenJDK #3624
Comments
@EzzhevNikita I usually install OpenJDK with choco https://community.chocolatey.org/packages/openjdk which I'm guessing does not create these keys. I there a reason that the logic has opted to check for registry keys rather than java being on the path or a JAVA_HOME environment variables? Seems like this might be a more robust way of checking for a java environment. Thanks for your help and quick response. |
@groogiam The main reason why we are using reg keys is that they are machine-specific, while env variables could change from user to user. And generally, registry keys are a more common and robust way to look for the installed programs on the machine. |
@EzzhevNikita This example seems to point to the contrary. I'm still failing to see why env variables are not the best option here. Yes they can be different from user to user but they would either be set system wide or on the account the agent service is running as. In either case the mechanism seems like it would work. I'm curious how this check is done on a linux agent. Seems like there might be an opportunity here to make this check more consistent across both linux and windows. |
This issue has had no activity in 180 days. Please comment if it is not actually stale |
@EzzhevNikita Any update on how this check is done on linux? |
How can nobody comment on this? |
I used task JavaToolInstaller (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/java-tool-installer?view=azure-devops) |
This issue has had no activity in 180 days. Please comment if it is not actually stale |
Can someone please provide some details on how this check is performed on Linux and why it can't be performed in a similar way on Windows? |
This issue has had no activity in 180 days. Please comment if it is not actually stale |
Can someone please provide some details on how this check is performed on Linux and why it can't be performed in a similar way on Windows? |
This issue has had no activity in 180 days. Please comment if it is not actually stale |
Can someone please provide some details on how this check is performed on Linux and why it can't be performed in a similar way on Windows? |
Agreed. Chocolatey is a common method of installing required system binaries. If the check on Linux doesn't require registry keys, then why can the Windows one not do the same check? This seems like an arbitrary restriction that is not adequately addressed by the JDK tool installer. |
I see that this issue is now over 2 years old, and Microsoft is clearly just going to let it mothball. Regardless of what happens, I will have to do additional maintenance work and/or build a Linux build server to get this going, and I won't pursue it any further than this last comment. Frankly, it's not a good look to leave issues to die, especially when there are only 113 issues in the list. Perhaps the reason is that it's not a particularly defensible position to close as "WONTFIX"? |
I am having a similar problem detecting the Temurin JDK installed in a self-hosted agent running Linux. I think the reason why those environment variables are not appearing is that Temurin JDK is not supported. |
To answer the badbot message the Unix versions of the agent don't bother to detect anything. Instead a bodge script copies a few of the env variables of user who installs the script into a file I guess the best, sort of, solution is to bodge it the same way. |
Agent Version and Platform
2.193.1
OS of the machine running the agent? OSX/Windows/Linux/...
Windows
Azure DevOps Type and Version
dev.azure.com
If dev.azure.com, what is your organization name?
https://dev.azure.com/flairsoft
What's not working?
The build agent does not seem to detect "java" capability for OpenJDK installations. This is described in #3402 and the last comment references this as fixed. The issue does not appear to be fixed as of 2.193.1 java is still not detected when OpenJDK is installed.
The text was updated successfully, but these errors were encountered: