We are trying to use a specific Java version on a TFS build pipeline. The build is being done using msbuild. The build server have two Java versions installed (i.e. 8 and 11). The PATH variable point to java 8, but in the msbuild we want to use Java 11 for the Android part.
It is asked to not change the PATH variable because other applications require Java 8, so wanted to know if there is any provision to pass the JDKPath directly to the msbuild using any command-line parameters.