function requirements() {
  // Closure Compiler after v20131014 requires Java 7.
  var required = $.semver('1.7.0');
  $.childProcess.exec('java -version', function(error, stdout, stderr) {
    if (error || !stderr) {
      $.util.error([
            'Unable to get java version.',
            'Please install java before building.',
          ].join('\n'));
      process.exit(1);
    }
    var version;
    var installed;
    try {
      version = stderr.split('\n')[0].split(' ').slice(-1)[0].replace(/"/g, '');
      // Replace underscores to make Java's version string semver-compatible.
      installed = $.semver.parse(version.replace('_', '-'));
    } catch (ex) {}
    if (!installed || installed < required) {
      $.util.error($.util.format([
            'Installed java version "%s" is less than the required "%s".',
            'Please upgrade java before building.'
          ].join('\n'), installed, required));
      process.exit(1);
    }
  });
}
Repeats a string a given number of times.

@param {string} str The string to repeat
@param {number} count The number of times to repeat.
@return {string}