private static void addManifestEntries(@NotNull Manifest manifest, @NotNull Map<String, String> entries)
    throws ManifestException {
    if (!entries.isEmpty()) {
      for (Map.Entry<String, String> entry : entries.entrySet()) {
        Attribute attr = manifest.getMainSection().getAttribute(entry.getKey());
        if ("Class-Path".equals(entry.getKey()) && attr != null) {
          // Merge the user-supplied Class-Path value with the programmatically
          // generated Class-Path.  Note that the user-supplied value goes first
          // so that resources there will override any in the standard Class-Path.
          attr.setValue(entry.getValue() + " " + attr.getValue());
        }
        else {
          addManifestAttribute(manifest, entry.getKey(), entry.getValue());
        }
      }
    }
  }
private static void addManifestEntries(@NotNull Manifest manifest, @NotNull Map<String, String> entries)