code: def locate(self, minimum_version=None, maximum_version=None, jdk=False):
      
  
      def _get_stricter_version(a, b, name, stricter):
        version_a = _parse_java_version(name, a)
        version_b = _parse_java_version(name, b)
        if version_a is None:
          return version_b
        if version_b is None:
          return version_a
        return stricter(version_a, version_b)
  
      # Take the tighter constraint of method args and subsystem options.
      minimum_version = _get_stricter_version(minimum_version,
                                              self._minimum_version,
                                              "minimum_version",
                                              max)
      maximum_version = _get_stricter_version(maximum_version,
                                              self._maximum_version,
                                              "maximum_version",
                                              min)
  
      key = (minimum_version, maximum_version, jdk)
      dist = self._cache.get(key)
      if not dist:
        dist = self._scan_constraint_match(minimum_version, maximum_version, jdk)
        if not dist:
          dist = self._locate(minimum_version=minimum_version,
                              maximum_version=maximum_version,
                              jdk=jdk)
        self._cache[key] = dist
      return dist
docs: Finds a java distribution that meets the given constraints and returns it.
  
      First looks for a cached version that was previously located, otherwise calls locate().
      :param minimum_version: minimum jvm version to look for (eg, 1.7).
                              The stricter of this and `--jvm-distributions-minimum-version` is used.
      :param maximum_version: maximum jvm version to look for (eg, 1.7.9999).
                              The stricter of this and `--jvm-distributions-maximum-version` is used.
      :param bool jdk: whether the found java distribution is required to have a jdk.
      :return: the Distribution.
      :rtype: :class:`Distribution`
      :raises: :class:`Distribution.Error` if no suitable java distribution could be found.