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

Clarifications needed in javax.tools

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 6
    • tools
    • generic
    • generic

      Good points. I need to come up with something more precise.

      There is also this little nit in JavaCompiler: "The versions of these
      specifications are defined in the Tool interface."

      On Dec 4, 2006, at 8:51 PM, ... wrote:

      >
      >
      >> -----Original Message-----
      >> From: ###@###.###
      >> Sent: Tuesday, 5 December 2006 2:53 PM
      >> To: compiler-dev@...
      >> Subject: Re: META-INF/services/...
      >>
      >> On Dec 4, 2006, at 8:18 PM, ... wrote:
      >>>
      >>> You may want to concider rewritting the javadoc for SE6 as well.
      >>>
      >>> http://download.java.net/jdk6/docs/api/javax/tools/Tool.html
      >>>
      >>> Specifically:
      >>>
      >>> "Tools can be located using ServiceLoader.load(Class)."
      >>
      >> Yes. Thank you for pointing this out.
      >
      >
      > You may also be interested in the following references:
      >
      > ToolProvider.java:
      > http://download.java.net/jdk6/docs/api/javax/tools/ToolProvider.html
      >
      > "Provides methods for locating tool providers, for example,
      > providers of compilers. This class complements the
      > functionality of ServiceLoader."
      >
      > And in the javax/tools package summary:
      > http://download.java.net/jdk6/docs/api/javax/tools/package-
      > summary.html
      >
      > "It is possible to provide alternative compilers or tools
      > through the service provider mechanism.
      >
      > For example, if com.vendor.VendorJavaCompiler is a
      > provider of the JavaCompiler tool then its jar file
      > would contain the file
      > META-INF/services/javax.tools.JavaCompiler. This
      > file would contain the single line:
      >
      > com.vendor.VendorJavaCompiler
      >
      > If the jar file is on the class path, VendorJavaCompiler
      > can be located using code like this:
      >
      > JavaCompiler compiler =
      > ServiceLoader.load(JavaCompiler.class).iterator().next();"
      >
      > (although strictly speaking the package summary is referencing
      > alternative compilers - although I should note that it is easy to
      > presume from the SE6 docs that standard javac would be visible
      > if tools.jar was in scope)

            jjg Jonathan Gibbons
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: