Skip to content

Commit 5311440

Browse files
committed
Update path to include JAVA
1 parent 261a238 commit 5311440

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

eng/scripts/InstallJdk.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ mkdir (split-path -parent $env:JAVA_HOME) -ea ignore | out-null
2525
Write-Host "Installing JDK to $env:JAVA_HOME"
2626
Move-Item "$tempDir/jdk/jdk-${jdkVersion}" $env:JAVA_HOME
2727
Write-Host "Done installing JDK to $env:JAVA_HOME"
28+
29+
if(-not $env:Path.Contains($env:JAVA_HOME)){
30+
Write-Host "Update PATH to include JAVA";
31+
$path = "$env:JAVA_HOME;$env:Path";
32+
[System.Environment]::SetEnvironmentVariable("PATH", $path, "User");
33+
}
34+
35+

0 commit comments

Comments
 (0)