Package org.gradle.process

# Interface JavaExecSpec

All Superinterfaces:
  `BaseExecSpec`, `JavaForkOptions`, `ProcessForkOptions`

All Known Implementing Classes:
  `JavaExec`

public interface JavaExecSpec extends JavaForkOptions, BaseExecSpec
Specifies the options for executing a Java application.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JavaExecSpec`
  `args(Iterable<?> args)`
  Adds args for the main class to be executed.
  `JavaExecSpec`
  `args(Object... args)`
  Adds args for the main class to be executed.
  `JavaExecSpec`
  `classpath(@Nullable Object... paths)`
  Adds elements to the classpath for executing the main class.
  `ListProperty<String>`
  `getArgs()`
  Returns the arguments passed to the main class to be executed.
  `ListProperty<CommandLineArgumentProvider>`
  `getArgumentProviders()`
  Argument providers for the application.
  `ConfigurableFileCollection`
  `getClasspath()`
  Returns the classpath for executing the main class.
  `ListProperty<String>`
  `getJvmArguments()`
  Extra JVM arguments to be to use to launch the JVM for the process.
  `Property<String>`
  `getMainClass()`
  The fully qualified name of the Main class to be executed.
  `Property<String>`
  `getMainModule()`
  The name of the main module to be executed if the application should run as a Java module.
  `ModularitySpec`
  `getModularity()`
  Returns the module path handling for executing the main class.

  ### Methods inherited from interface org.gradle.process.BaseExecSpec

  `getCommandLine, getErrorOutput, getIgnoreExitValue, getIsIgnoreExitValue, getStandardInput, getStandardOutput`

  ### Methods inherited from interface org.gradle.process.JavaForkOptions

  `bootstrapClasspath, copyTo, debugOptions, getAllJvmArgs, getBootstrapClasspath, getDebug, getDebugOptions, getDefaultCharacterEncoding, getEnableAssertions, getJvmArgs, getJvmArgumentProviders, getMaxHeapSize, getMinHeapSize, getSystemProperties, jvmArgs, jvmArgs, systemProperties, systemProperty`

  ### Methods inherited from interface org.gradle.process.ProcessForkOptions

  `copyTo, environment, environment, executable, getEnvironment, getExecutable, getWorkingDir, workingDir`

- ## Method Details

  - ### getJvmArguments

    @Incubating @Optional @Internal ListProperty<String> getJvmArguments()
    Extra JVM arguments to be to use to launch the JVM for the process. Must be used to set a convention for JVM arguments.
    Since:
      8.1

  - ### getMainModule

    @Optional @Input Property<String> getMainModule()
    The name of the main module to be executed if the application should run as a Java module.
    Since:
      6.4

  - ### getMainClass

    @Optional @Input Property<String> getMainClass()
    The fully qualified name of the Main class to be executed.

    This does not need to be set if using an Executable Jar with a `Main-Class` attribute.

    Since:
      6.4

  - ### getArgs

    @Optional @Input ListProperty<String> getArgs()
    Returns the arguments passed to the main class to be executed.

  - ### args

    JavaExecSpec args(Object... args)
    Adds args for the main class to be executed.
    Parameters:
      `args` - Args for the main class.
    Returns:
      this

  - ### args

    JavaExecSpec args(Iterable<?> args)
    Adds args for the main class to be executed.
    Parameters:
      `args` - Args for the main class.
    Returns:
      this

  - ### getArgumentProviders

    ListProperty<CommandLineArgumentProvider> getArgumentProviders()
    Argument providers for the application.
    Since:
      4.6

  - ### classpath

    JavaExecSpec classpath(@Nullable Object... paths)
    Adds elements to the classpath for executing the main class.
    Parameters:
      `paths` - classpath elements
    Returns:
      this

  - ### getClasspath

    @Classpath ConfigurableFileCollection getClasspath()
    Returns the classpath for executing the main class.

  - ### getModularity

    ModularitySpec getModularity()
    Returns the module path handling for executing the main class.
    Since:
      6.4