<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_jdk_version():
 """ 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. """

    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)