2 Replies Latest reply: Aug 25, 2009 4:21 AM by 608410 RSS

    How to use JavaCompiler.getTask()?

    cowwoc
      Hi,

      I'm trying to understand JavaCompiler.getTask(). I understand all parameters except for the 2nd to last one called "classes". The Javadoc read "class names (for annotation processing), null means no class names" but I don't understand what they mean. I found plenty of websites referring to JavaCompiler online, but none of them explain this parameter. Any ideas?

      Thanks,
      Gili
        • 1. Re: How to use JavaCompiler.getTask()?
          608410
          Hi Gili,


          I am pretty sure this is equivalent to the "-processor" command line option for javac.
          h:\>javac
          Usage: javac <options> <source files>
          where possible options include:
          !!!snip
            -processor <class1>[,<class2>,<class3>...]Names of the annotation processors to run; bypasses defa
          ult discovery process
          cheers

          Bruce
          • 2. Re: How to use JavaCompiler.getTask()?
            608410
            Retraction:


            I was wrong.


            Joe has just posted a JDK7 changeset for the javadocs to clarify this parameter.

            Here's the changeset [http://hg.openjdk.java.net/jdk7/tl/langtools/rev/2ce3597237f0]

            You can use this parameter to perform annotation processing on previously compiled class files.

            Bruce