For my java project, I am using azure devops pipeline for building. For configuring the jdkhome path, I am putting it in the toolchains xml file placed in root folder of project :
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
<vendor>oracle</vendor>
</provides>
<configuration>
<!--<jdkHome>/usr/lib/jvm/zulu-8-azure-amd64</jdkHome>-->
</configuration>
</toolchain>
But the azure devops agent has updated their jdk and its failing my build. So, now rather than hardcoding, I want to pick the path from agent. I see that on agent, environment variable is set as $JAVA_HOME_8_X64 with the path assigned to it.
So, how can I use this environment variable in my pipeline weather refer it in toolschain xml file or in some other way?
I tried to directly refer in xml and it did not work. I also tried to add some tasks from marketplace but did not work. Can someone help me with this?