Skip to content

Commit

Permalink
use explicit value for JAVA_HOME instead of "%JAVA_8_HOME%"
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspimentel committed Jan 14, 2025
1 parent 140b9b4 commit 81367a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions install-jdks-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ foreach ($jdkDir in $jdkDirs) {
$envVarName = "JAVA_${version}_HOME"
Write-Host "ℹ️ Setting $envVarName=$jdkDirFullName"
[System.Environment]::SetEnvironmentVariable($envVarName, $jdkDirFullName, [System.EnvironmentVariableTarget]::User)

if ($version -eq '8') {
Write-Host "ℹ️ Setting JAVA_HOME=$jdkDirFullName"
[System.Environment]::SetEnvironmentVariable('JAVA_HOME', $jdkDirFullName, [System.EnvironmentVariableTarget]::User)
}
}
}

Write-Host 'ℹ️ Setting JAVA_HOME=%JAVA_8_HOME%'
[System.Environment]::SetEnvironmentVariable('JAVA_HOME', '%JAVA_8_HOME%', [System.EnvironmentVariableTarget]::User)

0 comments on commit 81367a6

Please sign in to comment.