code: private static void runGraphviz(String dotExecutable, String outputFolder, String packageName, String name, RootDoc root) {
      if (dotExecutable == null) {
        dotExecutable = "dot";
      }
  	File dotFile = new File(outputFolder, packageName.replace(".", "/") + "/" + name + ".dot");
    File svgFile = new File(outputFolder, packageName.replace(".", "/") + "/" + name + ".svg");
  
  	try {
  	    Process p = Runtime.getRuntime().exec(new String [] {
  		dotExecutable,
      "-Tsvg",
  		"-o",
  		svgFile.getAbsolutePath(),
  		dotFile.getAbsolutePath()
  	    });
  	    BufferedReader reader = new BufferedReader(new InputStreamReader(p.getErrorStream()));
  	    String line;
  	    while((line = reader.readLine()) != null)
  		root.printWarning(line);
  	    int result = p.waitFor();
  	    if (result != 0)
  		root.printWarning("Errors running Graphviz on " + dotFile);
  	} catch (Exception e) {
  	    e.printStackTrace();
  	    System.err.println("Ensure that dot is in your path and that its path does not contain spaces");
  	}
      }
docs: Runs Graphviz dot building both a diagram (in png format) and a client side map for it.