Deprecate Java 7 (#2629)

This commit is contained in:
Dibir Magomedsaygitov
2021-02-05 18:22:20 +03:00
committed by GitHub
parent 9480083149
commit 01cd7ca628
5 changed files with 6 additions and 24 deletions

View File

@@ -10,11 +10,7 @@ function Set-JavaPath {
[switch] $Default
)
if ($Version -eq 7) {
$matchedString = "azure-jdk_7"
} else {
$matchedString = "jdk-?$Version"
}
$matchedString = "jdk-?$Version"
$javaPath = (Get-ChildItem -Path $JavaRootPath | Where-Object { $_ -match $matchedString}).FullName
if ([string]::IsNullOrEmpty($javaPath)) {
@@ -51,15 +47,6 @@ function Set-JavaPath {
}
}
function Install-Java7FromAzul {
param(
[string] $DestinationPath
)
$azulJDK7URL = 'https://repos.azul.com/azure-only/zulu/packages/zulu-7/7u232/zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64.zip'
$archivePath = Start-DownloadWithRetry -Url $azulJDK7URL -Name $([IO.Path]::GetFileName($azulJDK7URL))
Extract-7Zip -Path $archivePath -DestinationPath $DestinationPath
}
function Install-JavaFromAdoptOpenJDK {
param(
[string] $JDKVersion,
@@ -82,11 +69,7 @@ $defaultVersion = (Get-ToolsetContent).java.default
$javaRootPath = "C:\Program Files\Java\"
foreach ($jdkVersion in $jdkVersions) {
if ($jdkVersion -eq 7) {
Install-Java7FromAzul -DestinationPath $javaRootPath
} else {
Install-JavaFromAdoptOpenJDK -JDKVersion $jdkVersion -DestinationPath $javaRootPath
}
Install-JavaFromAdoptOpenJDK -JDKVersion $jdkVersion -DestinationPath $javaRootPath
if ($jdkVersion -eq $defaultVersion) {
Set-JavaPath -Version $jdkVersion -JavaRootPath $javaRootPath -Default