changeset 52989:18f36a093334

8215000: tools/launcher/JliLaunchTest.java fails on Windows Reviewed-by: bchristi, mchung
author henryjen
date Wed, 12 Dec 2018 11:45:10 -0800
parents 7c8f8949a07d
children 1ed8de9045a7
files test/jdk/tools/launcher/JliLaunchTest.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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());