Retrieve the Java version as reported in the quoted string returned
    by invoking 'java -version'.

    Works for Java 1.8, Java 9 and should also be fine for Java 10.
491369
def get_jdk_version():
    
    try:
        version = subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT)
    except OSError:
        print_("ERROR: Could not find java. Is it in your path?")
        exit(1)

    return _get_jdk_version(version)
966176
def version(self):
        """"""
        if not self.__version:
            command = (self.name, '--version')
            logger.debug(command)
            stdout, _ = subprocess.Popen(
                command, stdout=subprocess.PIPE).communicate()
            version_output = str(stdout)
            match = re.search(self.version_patt, version_output)
            if match is None:
                raise ServersError(
                    'Could not determine version of %s from string: %s'
                    % (self.name, version_output))
            version_string = match.group('version')
            self.__version = tuple(map(int, version_string.split('.')))
        return self.__version
1258195
function getVersion() {
    // parse the version number
    try {
      // find the executable
      var resolvedPath = which.sync(whichExec)

      // grab the raw output
      var result = shell.exec(`"${resolvedPath}" ${versionCommand}`, { silent: true })
      var rawOut = ramda.trim(result.stdout || '')
      var rawErr = ramda.trim(result.stderr || '') // java -version does this... grr

      // assign the "right" one to raw
      var raw = rawOut
      if (ramda.isEmpty(raw)) {
        raw = rawErr
      }
      if (ramda.isEmpty(raw)) {
        raw = null
      }

      // and run it by the version matcher
      return versionMatcher(raw)
    } catch (err) {
      return null
    }
  }
231221
public String getVersion()
	{
		String str = null;

		if ((version >= 0) && (version < versionLabels.length))
		{
			str = versionLabels[version];
		}

		return str;
	}
945466
@Column(header = Messages.GUI_MODULES_HEADER_VERSION_0, width = 80, order = 30)
    public String getVersion() {

        return m_module.getVersion().toString();
    }
1270750
def _extract_version(version_string, pattern):
    
    if version_string:
        match = pattern.match(version_string.strip())
        if match:
            return match.group(1)
    return ""
599939
def current_version_string():
    """"""
    return "{0}.{1}.{2}".format(sys.version_info.major,
                                sys.version_info.minor,
                                sys.version_info.micro)
1252562
def get_version():
    
    with open('sj.py') as source:
        for node in ast.walk(ast.parse(source.read(), 'sj.py')):
            if node.__class__.__name__ == 'Assign' and \
               node.targets[0].__class__.__name__ == 'Name' and \
               node.targets[0].id == '__version__':
                return node.value.s
1285443
public static double getJavaRunningVersionAsDouble() {
        String version = System.getProperty("java.version");
        int pos = version.indexOf('.');
        pos = version.indexOf('.', pos + 1);
        return Double.parseDouble(version.substring(0, pos));
    }
622160
public static String getJavaTargetVersionFromPom() {
        try {
            Properties properties = new Properties();
            ClassLoader classLoader = ClassLoader.getSystemClassLoader();
            properties.load(classLoader.getResourceAsStream("project.properties"));
            return "" + properties.getProperty("targetJavaVersion");
        } catch (Exception ex) {
            return "";
        }
    }
817523
def get_version(self):
        

        result = self._client.get("version").content

        if isinstance(result, bytes):
            result = result.decode('utf-8')

        return result.strip('\n')
212373
int version()
  {
    if (_version > 0) {
      return _version;
    }

    CharSegment protocol = getProtocolBuffer();
    if (protocol.equals("HTTP/1.1")) {
      _version = HTTP_1_1;
      return HTTP_1_1;
    }
    else if (protocol.equals("HTTP/1.0")) {
      _version = HTTP_1_0;
      return _version;
    }
    else if (protocol.equals("HTTP/0.9")) {
      _version = HTTP_0_9;
      return HTTP_0_9;
    }
    else if (protocol.length() < 8) {
      _version = HTTP_0_9;
      return _version;
    }

    int i = protocol.indexOf('/');
    int len = protocol.length();
    int major = 0;
    for (i++; i < len; i++) {
      char ch = protocol.charAt(i);

      if ('0' <= ch && ch <= '9')
        major = 10 * major + ch - '0';
      else if (ch == '.')
        break;
      else {
        _version = HTTP_1_0;
        return _version;
      }
    }

    int minor = 0;
    for (i++; i < len; i++) {
      char ch = protocol.charAt(i);

      if ('0' <= ch && ch <= '9')
        minor = 10 * minor + ch - '0';
      else
        break;
    }

    _version = 256 * major + minor;

    return _version;
  }
685047
def get_version():
    
    try:
        f = open('version.txt')
    except IOError:
        os.system("./version.sh > version.txt")
        f = open('version.txt')
    version = ''.join(f.readlines()).rstrip()
    f.close()
    return version
910713
public static String getVersionString() {
		String versionString = "UNKNOWN";
		Properties propeties = getProperites();
		if(propeties != null) {
			versionString = propeties.getProperty("finmath-lib.version");
		}
		return versionString;
	}
1065315
private static Version parseVersion(String version) {
		String[] parts = version.split("\\.");
		int nbParts = parts.length;
		int majorIndex = nbParts > 1 ? 1 : 0;
		int major = Integer.parseInt(parts[majorIndex]);
		return new Version(major);
	}
1312879
public java.lang.String getVersionUrl() {
    java.lang.Object ref = versionUrl_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      versionUrl_ = s;
      return s;
    }
  }
557293
public static String getVersion(InputStream is) {
		try {
			String text = readAsString(is);
			return getVersionFromText(text);
		} catch (IOException e) {
			LOG.error(e.getMessage(), e);
			return null;
		}
	}