Skip to content

Commit 153c1eb

Browse files
authored
Link to SYSTEM_JAVA_HOME on windows (#40806)
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 #40797
1 parent 8e3dabc commit 153c1eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void test53JavaHomeWithSpecialCharacters() throws Exception {
203203
final Shell sh = new Shell();
204204
try {
205205
// once windows 2012 is no longer supported and powershell 5.0 is always available we can change this command
206-
sh.run("cmd /c mklink /D 'C:\\Program Files (x86)\\java' $Env:JAVA_HOME");
206+
sh.run("cmd /c mklink /D 'C:\\Program Files (x86)\\java' $Env:SYSTEM_JAVA_HOME");
207207

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

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

219219
} finally {
220220
//clean up sym link
221-
sh.run("cmd /c del /F /Q 'C:\\Program Files (x86)\\java' ");
221+
sh.run("cmd /c rmdir 'C:\\Program Files (x86)\\java' ");
222222
}
223223
});
224224

0 commit comments

Comments
 (0)