microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 864 forks source link

[BUG]: Self-Hosted Ubuntu 22.04 fails to detect JAVA_HOME environment variables when using Temurin JDK. #4911

Open sicil1ano opened 1 month ago

sicil1ano commented 1 month ago

What happened?

I am using the exact same image used by Microsoft for their hosted agents to run a self-hosted Ubuntu 22.04 agent (https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml and https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md) and JAVA_HOME environment variables are not appearing in the System capabilities.

The environment variables are part of the PATH (if that exists in Linux):

adminuser@vmss-agents-1:~/azdevopsagent$ $JAVA_HOME_17_X64
-bash: /usr/lib/jvm/temurin-17-jdk-amd64: Is a directory
adminuser@vmss-agents-1:~/azdevopsagent$ $JAVA_HOME_11_X64
-bash: /usr/lib/jvm/temurin-11-jdk-amd64: Is a directory
adminuser@vmss-agents-1:~/azdevopsagent$ $JAVA_HOME
-bash: /usr/lib/jvm/temurin-11-jdk-amd64: Is a directory

The agent installs Temurin JDKs and I think the agent is not supporting those.

Please see this for details: https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-java-tools.sh

Versions

Azure DevOps 3.242.1 - Ubuntu 22.04

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

No response

Version controll system

No response

Relevant log output

No response

kirill-ivlev commented 1 month ago

Hi @sicil1ano, thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.