public static String createManifestJar(List<String> entries, String location) throws IOException {
    // Must use the canonical path so that symbolic links are resolved correctly
    Path locationPath = new File(location).getCanonicalFile().toPath();
    Files.createDirectories(locationPath);

    List<String> manifestEntries = new ArrayList<>();
    for (String jarEntry : entries) {
      Path jarEntryAbsolutePath = Paths.get(jarEntry).toAbsolutePath();
      Path jarEntryRelativizedPath = locationPath.relativize(jarEntryAbsolutePath);
      if (jarEntryAbsolutePath.toFile().isDirectory()) {
        manifestEntries.add(jarEntryRelativizedPath + File.separator);
      } else {
        manifestEntries.add(jarEntryRelativizedPath.toString());
      }
    }

    Manifest manifest = new Manifest();
    Attributes attributes = manifest.getMainAttributes();
    attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0.0");
    attributes.put(new Attributes.Name("Class-Path"), String.join(" ", manifestEntries));

    // Generate a 'unique' 8 char name
    String uuid = UUID.randomUUID().toString().substring(0, 8);
    Path manifestJarPath = Paths.get(location, "manifest-" + uuid + ".jar");
    File manifestJarFile = manifestJarPath.toFile();
    manifestJarFile.deleteOnExit();

    try (JarOutputStream jos =
        new JarOutputStream(new FileOutputStream(manifestJarFile), manifest)) {
      // the above try-with-resource writes the manifest to the manifestJarFile
    }

    return manifestJarPath.toFile().getAbsolutePath();
  }
Wraps spawned {@link Process} to capture output and provide interaction with the process.

@since GemFire 4.1.1
geode-junit/src/main/java/org/apache/geode/test/process/ProcessWrapper.java