def _extract_jdk_version(java_version_out):
 match = re.search('Runtime Environment \\(build (.*?)\\)', java_version_out)
 if (match is None):
  return None
 (version, build) = match.group(1).split('-')
 release = version.split('_')[0].split('.')[1]
 update = str(int(version.split('_')[1]))
 return ('%(release)su%(update)s-%(build)s' % locals())

def _extract_jdk_version ( java_version_out ) : match = re . search ( 'Runtime Environment \\(build (.*?)\\)' , java_version_out ) if ( match is None ) : return None ( version , build ) = match . group ( 1 ) . split ( '-' ) release = version . split ( '_' ) [ 0 ] . split ( '.' ) [ 1 ] update = str ( int ( version . split ( '_' ) [ 1 ] ) ) return ( '%(release)su%(update)s-%(build)s' % locals ( ) )
extracts jdk version in format like 7u13-b20 from java -version command output .