Skip to content

Commit

Permalink
Link to SYSTEM_JAVA_HOME on windows (elastic#40806)
Browse files Browse the repository at this point in the history
We don't always have java home defined in packaging tests, as we want to
use the bundled jdk most of the time. This commit fixes the java home
with special characters test to link to SYSTEM_JAVA_HOME on windows.

closes elastic#40797
  • Loading branch information
rjernst authored Apr 4, 2019
1 parent 8e3dabc commit 153c1eb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void test53JavaHomeWithSpecialCharacters() throws Exception {
final Shell sh = new Shell();
try {
// once windows 2012 is no longer supported and powershell 5.0 is always available we can change this command
sh.run("cmd /c mklink /D 'C:\\Program Files (x86)\\java' $Env:JAVA_HOME");
sh.run("cmd /c mklink /D 'C:\\Program Files (x86)\\java' $Env:SYSTEM_JAVA_HOME");

sh.getEnv().put("JAVA_HOME", "C:\\Program Files (x86)\\java");

Expand All @@ -218,7 +218,7 @@ public void test53JavaHomeWithSpecialCharacters() throws Exception {

} finally {
//clean up sym link
sh.run("cmd /c del /F /Q 'C:\\Program Files (x86)\\java' ");
sh.run("cmd /c rmdir 'C:\\Program Files (x86)\\java' ");
}
});

Expand Down

0 comments on commit 153c1eb

Please sign in to comment.