def execute_java(classpath, main, jvm_options=None, args=None, executor=None,
                 workunit_factory=None, workunit_name=None, workunit_labels=None,
                 cwd=None, workunit_log_config=None, distribution=None,
                 create_synthetic_jar=True, synthetic_jar_dir=None):
  """Executes the java program defined by the classpath and main.

  If `workunit_factory` is supplied, does so in the context of a workunit.

  :param list classpath: the classpath for the java program
  :param string main: the fully qualified class name of the java program's entry point
  :param list jvm_options: an optional sequence of options for the underlying jvm
  :param list args: an optional sequence of args to pass to the java program
  :param executor: an optional java executor to use to launch the program; defaults to a subprocess
    spawn of the default java distribution
  :param workunit_factory: an optional callable that can produce a workunit context
  :param string workunit_name: an optional name for the work unit; defaults to the main
  :param list workunit_labels: an optional sequence of labels for the work unit
  :param string cwd: optionally set the working directory
  :param WorkUnit.LogConfig workunit_log_config: an optional tuple of options affecting reporting
  :param bool create_synthetic_jar: whether to create a synthentic jar that includes the original
    classpath in its manifest.
  :param string synthetic_jar_dir: an optional directory to store the synthetic jar, if `None`
    a temporary directory will be provided and cleaned up upon process exit.

  Returns the exit code of the java program.
  Raises `pants.java.Executor.Error` if there was a problem launching java itself.
  """

  runner = _get_runner(classpath, main, jvm_options, args, executor, cwd, distribution,
                       create_synthetic_jar, synthetic_jar_dir)
  workunit_name = workunit_name or main

  return execute_runner(runner,
                        workunit_factory=workunit_factory,
                        workunit_name=workunit_name,
                        workunit_labels=workunit_labels,
                        workunit_log_config=workunit_log_config)
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/java/util.py/execute_java/original