@classmethod
  def detect_java_version(cls, java_executable='java'):
    try:
      p = subprocess.Popen([java_executable, '-version'],
                           stderr=subprocess.PIPE)
      line = p.communicate()[1]
      return re.search(r'[0-9\.]+', line).group()
    except:
      return None
Tests if the repository contains a particular version of a trove.
dataset/ETHPy150Open google/anvil-build/anvil/task.py/JavaExecutableTask.detect_java_version--crossover with--dataset/ETHPy150Open sassoftware/conary/conary/repository/repository.py/AbstractRepository.hasTrove