langtools/test/tools/javac/T6405099.java
changeset 36526 3b41f1c69604
parent 30730 d3ce7619db2c
--- a/langtools/test/tools/javac/T6405099.java	Tue Mar 15 13:48:30 2016 -0700
+++ b/langtools/test/tools/javac/T6405099.java	Thu Mar 17 19:04:28 2016 +0000
@@ -49,16 +49,19 @@
 
     static void test(File dir) {
         String[] args = {
-            "-extdirs", dir.getPath(), "-d", ".",
+            "-source", "8", "-target", "8", // -extdirs not allowed after -target 8
+            "-extdirs", dir.getPath(),
+            "-d", ".",
             new File(System.getProperty("test.src", "."), "T6405099.java").getPath()
         };
 
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         int rc = com.sun.tools.javac.Main.compile(args, pw);
+        pw.close();
+        System.out.println(sw);
+
         if (rc != 0)
             throw new Error("compilation failed");
-
-        System.out.println(sw);
     }
 }