test/hotspot/jtreg/gtest/GTestWrapper.java
changeset 53273 bbc79e0ec9ee
parent 49963 93a7cbd3f838
child 55349 139f21bad9fd
--- a/test/hotspot/jtreg/gtest/GTestWrapper.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/hotspot/jtreg/gtest/GTestWrapper.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 import java.util.stream.Stream;
 import java.util.stream.Collectors;
 
+import java.io.File;
 import java.nio.file.Paths;
 import java.nio.file.Path;
 
@@ -69,14 +70,10 @@
         // may have set LD_LIBRARY_PATH or LIBPATH to point to the jdk libjvm. In
         // that case, prepend the path with the location of the gtest library."
 
-        String ldLibraryPath = System.getenv("LD_LIBRARY_PATH");
+        String pathVar = Platform.sharedLibraryPathVariableName();
+        String ldLibraryPath = System.getenv(pathVar);
         if (ldLibraryPath != null) {
-            env.put("LD_LIBRARY_PATH", path + ":" + ldLibraryPath);
-        }
-
-        String libPath = System.getenv("LIBPATH");
-        if (libPath != null) {
-            env.put("LIBPATH", path + ":" + libPath);
+            env.put(pathVar, path + File.pathSeparator + ldLibraryPath);
         }
 
         pb.command(new String[] {