public void buildJar(File outputJarFile, File... sourceFiles) throws IOException {
    List<InMemoryClassFile> compiledSourceCodes = javaCompiler.compile(sourceFiles);

    buildJar(outputJarFile, compiledSourceCodes);
  }
This class accepts java source code in the format of .java source files or strings containing the
contents of .java source files, and compiles the given source code into a jar file specified by
the user.

<p>
Example of usage:

<pre>
`` *
&#064;Test
public void buildJarUsingStrings() {
  JarBuilder jarBuilder = new JarBuilder();
  File outputJar = new File("output.jar");

  String classInFooBarPackage = &quot;package foo.bar; public class ClassA {int n = 10;}&quot;;
  String classInDefaultPackage = &quot;public class ClassB {}&quot;;
  jarBuilder.buildJar(outputJar, classInFooBarPackage, classInDefaultPackage);
}

&#064;Test
public void buildJarUsingFiles() {
  JarBuilder jarBuilder = new JarBuilder();
  File outputJar = new File("output.jar");

  // The following two files are expected to contain valid Java source code
  File sourceFileOne = new File("ClassA.java");
  File sourceFileTwo = new File("ClassB.java");
  jarBuilder.buildJar(outputJar, sourceFileOne, sourceFileTwo);
}

</pre>
geode-junit/src/main/java/org/apache/geode/test/compiler/JarBuilder.java