private void parseVersion(String version) throws ParseException {
		if (version == null) {
			throw new ParseException("Version is null", 0);
		}

		major = minor = patch = 0;

		// Remove any surrounding double quotes
		if (version.startsWith("\"") && version.endsWith("\"")) {
			version = version.substring(1, version.length() - 1);
		}

		// Remove any trailing dash section (9-Ubuntu is a thing).
		int dashIndex = version.indexOf('-');
		if (dashIndex > 0) {
			version = version.substring(0, dashIndex);
		}

		String[] versionParts = version.split("[._]");
		int firstValue = parseVersionPart(versionParts[0], "first value");
		if (firstValue == 1) {
			// Follows the Java 8 and earlier format of 1.major.minor_patch
			if (versionParts.length > 1) {
				major = parseVersionPart(versionParts[1], "major");
				if (versionParts.length > 2) {
					minor = parseVersionPart(versionParts[2], "minor");
					if (versionParts.length > 3) {
						patch = parseVersionPart(versionParts[3], "patch");
					}
				}
			}
		}
		else if (firstValue >= 9) {
			// Follows the Java 9 and later format of major.minor.patch
			major = parseVersionPart(versionParts[0], "major");
			if (versionParts.length > 1) {
				minor = parseVersionPart(versionParts[1], "minor");
				if (versionParts.length > 2) {
					patch = parseVersionPart(versionParts[2], "patch");
				}
			}
		}
		else {
			throw new ParseException("Failed to parse version: " + version, 0);
		}
	}
Parses the major, minor, and optional patch integers out of the given version string.

@param version A version string.
@throws ParseException if the version string failed to parse.  The exception's message 
has more detailed information about why it failed.
GhidraBuild/LaunchSupport/src/main/java/ghidra/launch/JavaVersion.java