code: public static String findSingleMainClass(JarFile jarFile, String classesLocation,
  			String annotationName) throws IOException {
  		SingleMainClassCallback callback = new SingleMainClassCallback(annotationName);
  		MainClassFinder.doWithMainClasses(jarFile, classesLocation, callback);
  		return callback.getMainClassName();
  	}
docs: Find a single main class in a given jar file. A main class annotated with an
  annotation with the given {@code annotationName} will be preferred over a main
  class with no such annotation.
  @param jarFile the jar file to search
  @param classesLocation the location within the jar containing classes
  @param annotationName the name of the annotation that may be present on the main
  class
  @return the main class or {@code null}
  @throws IOException if the jar file cannot be read