Skip to content

Commit 3dd9685

Browse files
committed
fixup: windows
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
1 parent 4dfd938 commit 3dd9685

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

windows/windowsservercore/hotspot/Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ RUN New-Item -ItemType Directory -Path $env:jdkTemp | Out-Null ; `
1717
Expand-Archive -Path $env:localArchive -DestinationPath $env:jdkTemp ; `
1818
$expandedDir = Get-ChildItem -Path $env:jdkTemp -Directory | Where-Object { $_.Name -like 'jdk*' } ; `
1919
Move-Item -Path $expandedDir.FullName -Destination $env:jdkTempHome -Force ; `
20-
Remove-Item -Path $env:jdkTemp -Recurse | Out-Null
21-
22-
RUN Write-Host 'javac --version' ; $env:jdkTempHome/javac --version ; `
23-
Write-Host 'java --version' ; $env:jdkTempHome/java --version
20+
Remove-Item -Path $env:jdkTemp -Recurse | Out-Null ; `
21+
$CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; `
22+
$NewPath = $CurrentPath + $(';{0}/bin' -f $env:jdkTempHome) ; `
23+
Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath
2424

25-
RUN $version = ($env:jdkTempHome/jlink --version) ; `
25+
RUN Write-Host 'java --version' ; java --version ; `
26+
Write-Host 'javac --version' ; javac --version ; `
27+
$version = (jlink --version) ; `
2628
$javaMajorVersion = $version.Substring(0,2) ; `
2729
if ($javaMajorVersion -eq '25') { `
28-
Move-Item -Path $$env:jdkTempHome -Destination C:\javaruntime -Recurse ; `
30+
Move-Item -Path $env:jdkTempHome -Destination C:\javaruntime ; `
2931
} else { `
3032
$options = '--compress=2' ; `
3133
switch ($version.Substring(0,3)) { `
@@ -35,7 +37,7 @@ RUN $version = ($env:jdkTempHome/jlink --version) ; `
3537
exit 1 ; `
3638
} `
3739
} `
38-
& $env:jdkTempHome/jlink `
40+
& jlink `
3941
--strip-java-debug-attributes `
4042
$options `
4143
--add-modules ALL-MODULE-PATH `

0 commit comments

Comments
 (0)