I need to use Java 14 on a hosted agent (macos-12) and I'm trying to install it through a script and then use the JavaToolInstaller task to make it available.
I have modified the script from https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/java-tool-installer?view=azure-devops
jobs:
- job: RunApiTests
pool:
vmImage: macOS-12
condition: ne(variables['Build.SourceBranch'], 'refs/heads/main')
steps:
- task: JavaToolInstaller@0
displayName: Install Java 14
inputs:
versionSpec: '14'
jdkArchitectureOption: 'x64'
jdkSourceOption: AzureStorage
azureResourceManagerEndpoint: {azureResourceManagerEndpoint}
azureStorageAccountName: {azureStorageAccountName}
azureContainerName: openjdk
azureCommonVirtualFile: 'openjdk-14.0.2.zip'
jdkDestinationDirectory: '$(agent.toolsDirectory)/jdk14'
cleanDestinationDirectory: false
Below is the error I am getting:
##[error]JDK file is not valid. Verify if JDK file contains only one root folder with 'bin' inside.
I downloaded the 14.0.2 (build 14.0.2+12) jdk
for Mac from https://jdk.java.net/archive/ and I compressed only the Home
folder to a zip file because bin
is in there.
So, as per the requirement, the zip file contains only one root folder 'Home'
with bin
inside.
I need help on why I'm getting this error.