jdk/test/tools/jar/compat/CLICompatibility.java
changeset 38762 2956ccc7cb77
parent 36511 9d0388c6b336
child 39313 0970a9a1de13
--- a/jdk/test/tools/jar/compat/CLICompatibility.java	Tue May 31 22:41:56 2016 +0000
+++ b/jdk/test/tools/jar/compat/CLICompatibility.java	Tue May 31 16:42:32 2016 -0700
@@ -57,6 +57,8 @@
     static final Path TEST_CLASSES = Paths.get(System.getProperty("test.classes", "."));
     static final Path USER_DIR = Paths.get(System.getProperty("user.dir"));
 
+    static final String TOOL_VM_OPTIONS = System.getProperty("test.tool.vm.opts", "");
+
     final boolean legacyOnly;  // for running on older JDK's ( test validation )
 
     // Resources we know to exist, that can be used for creating jar files.
@@ -501,6 +503,9 @@
         String jar = getJDKTool("jar");
         List<String> commands = new ArrayList<>();
         commands.add(jar);
+        if (!TOOL_VM_OPTIONS.isEmpty()) {
+            commands.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1)));
+        }
         Stream.of(args).map(s -> s.split(" "))
                        .flatMap(Arrays::stream)
                        .forEach(x -> commands.add(x));