Pipelines/Steps/Install/OnPrem/Solr/Install-Prerequisites.ps1

$ErrorActionPreference = "Stop"

function InstallOpenJDK {
    try {
        choco upgrade adoptopenjdk8 -PackageParameters "/exclude:32" -y --limitoutput
        RefreshEnvironment
    }
    catch {
        Write-Warning "SAF was not able to install the latest OpenJDK. Please, install it manually..."
        Start-Sleep 5
    }
}

Write-Output "Configuring Solr Prerequisites..."
InstallOpenJDK
Write-Output "Configuring Solr Prerequisites done."