Package: org.gradle.process

## [Java] Interface JavaExecSpec

- org.gradle.process.ProcessForkOptions

- All Superinterfaces:
    BaseExecSpec, JavaForkOptions, ProcessForkOptions

  Specifies the options for executing a Java application.

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `JavaExecSpec` | `args(Object... args)` Adds args for the main class to be executed.
    `JavaExecSpec` | `args(Iterable<?> args)` Adds args for the main class to be executed.
    `JavaExecSpec` | `classpath(Object... paths)` Adds elements to the classpath for executing the main class.
    `List<String>` | `getArgs()` Returns the arguments passed to the main class to be executed.
    `FileCollection` | `getClasspath()` Returns the classpath for executing the main class.
    `String` | `getMain()` Returns the fully qualified name of the Main class to be executed.
    `JavaExecSpec` | `setArgs(Iterable<?> args)` Sets the args for the main class to be executed.
    `JavaExecSpec` | `setClasspath(FileCollection classpath)` Sets the classpath for executing the main class.
    `JavaExecSpec` | `setMain(String main)` Sets the fully qualified name of the main class to be executed.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface BaseExecSpec` | `getCommandLine, getErrorOutput, getStandardInput, getStandardOutput, isIgnoreExitValue, setErrorOutput, setIgnoreExitValue, setStandardInput, setStandardOutput`
    `interface JavaForkOptions` | `bootstrapClasspath, copyTo, getAllJvmArgs, getBootstrapClasspath, getDebug, getDefaultCharacterEncoding, getEnableAssertions, getJvmArgs, getMaxHeapSize, getMinHeapSize, getSystemProperties, jvmArgs, jvmArgs, setAllJvmArgs, setBootstrapClasspath, setDebug, setDefaultCharacterEncoding, setEnableAssertions, setJvmArgs, setMaxHeapSize, setMinHeapSize, setSystemProperties, systemProperties, systemProperty`

- - ### Method Detail

    - #### public JavaExecSpec args(Object... args)

      Adds args for the main class to be executed.

      Parameters:
        `args` - Args for the main class.
      Returns:
        this

    - #### public JavaExecSpec args(Iterable<?> args)

      Adds args for the main class to be executed.

      Parameters:
        `args` - Args for the main class.
      Returns:
        this

    - #### public JavaExecSpec classpath(Object... paths)

      Adds elements to the classpath for executing the main class.

      Parameters:
        `paths` - classpath elements
      Returns:
        this

    - #### public List<String> getArgs()

      Returns the arguments passed to the main class to be executed.

    - #### public FileCollection getClasspath()

      Returns the classpath for executing the main class.

    - #### public String getMain()

      Returns the fully qualified name of the Main class to be executed.

    - #### public JavaExecSpec setArgs(Iterable<?> args)

      Sets the args for the main class to be executed.

      Parameters:
        `args` - Args for the main class.
      Returns:
        this

    - #### public JavaExecSpec setClasspath(FileCollection classpath)

      Sets the classpath for executing the main class.

      Parameters:
        `classpath` - the classpath
      Returns:
        this

    - #### public JavaExecSpec setMain(String main)

      Sets the fully qualified name of the main class to be executed.

      Parameters:
        `main` - the fully qualified name of the main class to be executed.
      Returns:
        this