8223054: [TESTBUG] Put graalJarsCP before existing classpath in GraalUnitTestLauncher
authorpli
Tue, 07 May 2019 00:58:10 +0000
changeset 54730 8bca46822c05
parent 54729 f72402697b2f
child 54731 81de17a33575
8223054: [TESTBUG] Put graalJarsCP before existing classpath in GraalUnitTestLauncher Reviewed-by: iignatyev, dlong
test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java
--- a/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java	Mon May 06 21:23:23 2019 -0400
+++ b/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java	Tue May 07 00:58:10 2019 +0000
@@ -254,7 +254,11 @@
                                       .collect(Collectors.joining(File.pathSeparator));
 
         javaFlags.add("-cp");
-        javaFlags.add(String.join(File.pathSeparator, System.getProperty("java.class.path"), graalJarsCP));
+        // Existing classpath returned by System.getProperty("java.class.path") may contain another
+        // version of junit with which the jtreg tool is built. It may be incompatible with required
+        // junit version. So we put graalJarsCP before existing classpath when generating a new one
+        // to avoid incompatibility issues.
+        javaFlags.add(String.join(File.pathSeparator, graalJarsCP, System.getProperty("java.class.path")));
 
         //
         javaFlags.add("com.oracle.mxtool.junit.MxJUnitWrapper");