8215000: tools/launcher/JliLaunchTest.java fails on Windows
authorhenryjen
Wed, 12 Dec 2018 11:45:10 -0800
changeset 52989 18f36a093334
parent 52988 7c8f8949a07d
child 52990 1ed8de9045a7
8215000: tools/launcher/JliLaunchTest.java fails on Windows Reviewed-by: bchristi, mchung
test/jdk/tools/launcher/JliLaunchTest.java
--- a/test/jdk/tools/launcher/JliLaunchTest.java	Wed Dec 12 11:17:21 2018 -0800
+++ b/test/jdk/tools/launcher/JliLaunchTest.java	Wed Dec 12 11:45:10 2018 -0800
@@ -49,10 +49,12 @@
         Map<String, String> env = pb.environment();
         if (Platform.isWindows()) {
             // The DLL should be in JDK/bin
+            String libdir = Paths.get(Utils.TEST_JDK).resolve("bin").toAbsolutePath().toString();
+            env.compute("PATH", (k, v) -> (v == null) ? libdir : libdir + ";" + v);
         } else {
             String libdir = Paths.get(Utils.TEST_JDK).resolve("lib").toAbsolutePath().toString();
             String LD_LIBRARY_PATH = Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH";
-            env.compute(LD_LIBRARY_PATH, (k, v) -> (k == null) ? libdir : v + ":" + libdir);
+            env.compute(LD_LIBRARY_PATH, (k, v) -> (v == null) ? libdir : libdir + ":" + v);
         }
 
         OutputAnalyzer outputf = new OutputAnalyzer(pb.start());