def METHOD_NAME(majors, sysprop_reader=system_property):
    """
    Resolves the path to the JDK with the provided major version(s). It checks the versions in the same order specified in ``majors``
    and will return the first match. To achieve this, it first checks the major version x in the environment variable ``JAVAx_HOME``
    and falls back to ``JAVA_HOME``. It also ensures that the environment variable points to the right JDK version.
    If no appropriate version is found, a ``SystemSetupError`` is raised.
    :param majors: Either a list of major versions to check or a single version as an ``int``.
    :param sysprop_reader: (Optional) only relevant for testing.
    :return: A tuple of (major version, path to Java home directory).
    """
    if isinstance(majors, int):
        return majors, _resolve_single_path(majors, sysprop_reader=sysprop_reader)
    else:
        for major in majors:
            java_home = _resolve_single_path(major, mandatory=False, sysprop_reader=sysprop_reader)
            if java_home:
                return major, java_home
        raise exceptions.SystemSetupError("Install a JDK with one of the versions {} and point to it with one of {}."
                                          .format(majors, _checked_env_vars(majors)))