< prev index next >

test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java

Print this page
rev 54640 : 8223054: [TESTBUG] Put graalJarsCP before existing classpath in GraalUnitTestLauncher
Reviewed-by: duke

@@ -252,11 +252,15 @@
         String graalJarsCP = graalJars.stream()
                                       .map(s -> String.join(File.separator, libsDir, s))
                                       .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");
         javaFlags.add("-JUnitVerbose");
         javaFlags.add("-JUnitEagerStackTrace");
< prev index next >