Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6423003

JSR 199: confusing help message with compiler API

XMLWordPrintable

    • b03
    • generic
    • generic
    • Verified

      Confusing help message with compiler API.

      <src>
      import java.util.Arrays;
      import javax.tools.*;

      public class T6423003 {
          public static void main(String... arg) throws Throwable {
              JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
              javac.getTask(null, null, null, Arrays.asList("-Xlint:all"), null, null).call();
          }
      }
      </src>
      output of the message:
      <output>
      bash-3.00$ java T6423003
      javacTask: no source files
      ^^^^^^^^^
      Usage: javacTask <options> <source files>
      use -help for a list of possible options
      </output>

      There is some inconsistency between running through command line and running through compiler API also javacTask will be confusing to the user since its more of internal name.

            ahe Peter Ahe
            savadhansunw Seetharama Avadhanam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: