def _tools_classpath(self):
    """Returns a classpath representing the (equivalent of the) `tools.jar`.

    If `javac` has been set explicitly, it is used. Otherwise, searches the current distribution.
    """

    javac_classpath = Java.global_javac_classpath(self.context.products)
    if javac_classpath:
      return javac_classpath

    self.set_distribution(jdk=True)
    jars = self.dist.find_libs(['tools.jar'])
    if len(jars) != 1:
      raise TaskError('Expected a single `tools.jar` entry for {}; got: {}'.format(
        self.dist, jars))
    return jars
Returns a classpath representing the (equivalent of the) `tools.jar`.

    If `javac` has been set explicitly, it is used. Otherwise, searches the current distribution.