diff --git a/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java b/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java index c874d74e75b1f3d37c195369e26d0e94c2b582f8..e11a39f48c8bee7e8985daf0d0b12d2ab939697d 100644 --- a/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java +++ b/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java @@ -58,11 +58,14 @@ public class TestWithXstdout { if (javaHome.getName().equals("jre")) javaHome = javaHome.getParentFile(); File javac = new File(new File(javaHome, "bin"), "javac"); - String toolOpts = System.getProperty("test.tool.vm.opts"); List opts = new ArrayList<>(); opts.add(javac.getPath()); - opts.addAll(Arrays.asList(toolOpts.trim().split("[\\s]+"))); + + String toolOpts = System.getProperty("test.tool.vm.opts"); + if (toolOpts != null && !"".equals(toolOpts.trim())) { + opts.addAll(Arrays.asList(toolOpts.trim().split("[\\s]+"))); + } opts.addAll(Arrays.asList(args)); System.out.println("exec: " + opts); ProcessBuilder pb = new ProcessBuilder(opts);