Fix detection of the JDK from a registry setting

This commit is contained in:
Nate McMaster 2019-05-20 08:51:01 -07:00
parent 194b0b4523
commit 630af4d319
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
1 changed files with 1 additions and 1 deletions

View File

@ -331,7 +331,7 @@ if (($All -or $BuildJava) -and -not $NoBuildJava) {
try {
$jdkVersion = (Get-Item HKLM:\SOFTWARE\JavaSoft\JDK | Get-ItemProperty -name CurrentVersion).CurrentVersion
$javaHome = (Get-Item HKLM:\SOFTWARE\JavaSoft\JDK\$jdkVersion | Get-ItemProperty -Name JavaHome).JavaHome
if (Test-Path "${env:JAVA_HOME}\bin\java.exe") {
if (Test-Path "$javaHome\bin\javac.exe") {
$env:JAVA_HOME = $javaHome
Write-Host -f Magenta "Detected JDK $jdkVersion in $env:JAVA_HOME (via registry)"
$foundJdk = $true