Package: org.gradle.api.tasks

## [Java] Class JavaExec

- org.gradle.api.tasks.JavaExec

- All Implemented Interfaces and Traits:
    JavaExecSpec

      public class JavaExec
      extends ConventionTask

  Executes a Java application in a child process.

  The process can be started in debug mode (see getDebug()) in an ad-hoc manner by supplying the `--debug-jvm` switch when invoking the build.

       gradle someJavaExecTask --debug-jvm

- - ### Constructor Summary

    Constructors
    Constructor and description
    `JavaExec ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `JavaExec` | `args(Object... args)` {@inheritDoc}
    `JavaExecSpec` | `args(Iterable<?> args)` {@inheritDoc}
    `JavaExec` | `bootstrapClasspath(Object... classpath)` {@inheritDoc}
    `JavaExec` | `classpath(Object... paths)` {@inheritDoc}
    `JavaExec` | `copyTo(JavaForkOptions options)` {@inheritDoc}
    `JavaExec` | `copyTo(ProcessForkOptions target)` {@inheritDoc}
    `JavaExec` | `environment(String name, Object value)` {@inheritDoc}
    `JavaExec` | `environment(Map<String, ?> environmentVariables)` {@inheritDoc}
    `void` | `exec()`
    `JavaExec` | `executable(Object executable)` {@inheritDoc}
    `List<String>` | `getAllJvmArgs()` {@inheritDoc}
    `List<String>` | `getArgs()` {@inheritDoc}
    `FileCollection` | `getBootstrapClasspath()` {@inheritDoc}
    `FileCollection` | `getClasspath()` {@inheritDoc}
    `List<String>` | `getCommandLine()` {@inheritDoc}
    `boolean` | `getDebug()` {@inheritDoc}
    `String` | `getDefaultCharacterEncoding()` {@inheritDoc}
    `boolean` | `getEnableAssertions()` {@inheritDoc}
    `Map<String, Object>` | `getEnvironment()` {@inheritDoc}
    `OutputStream` | `getErrorOutput()` {@inheritDoc}
    `String` | `getExecutable()` {@inheritDoc}
    `protected FileResolver` | `getFileResolver()`
    `List<String>` | `getJvmArgs()` {@inheritDoc}
    `String` | `getMain()` {@inheritDoc}
    `String` | `getMaxHeapSize()` {@inheritDoc}
    `String` | `getMinHeapSize()` {@inheritDoc}
    `InputStream` | `getStandardInput()` {@inheritDoc}
    `OutputStream` | `getStandardOutput()` {@inheritDoc}
    `Map<String, Object>` | `getSystemProperties()` {@inheritDoc}
    `File` | `getWorkingDir()` {@inheritDoc}
    `boolean` | `isIgnoreExitValue()` {@inheritDoc}
    `JavaExec` | `jvmArgs(Iterable<?> arguments)` {@inheritDoc}
    `JavaExec` | `jvmArgs(Object... arguments)` {@inheritDoc}
    `void` | `setAllJvmArgs(Iterable<?> arguments)` {@inheritDoc}
    `JavaExec` | `setArgs(Iterable<?> applicationArgs)` {@inheritDoc}
    `void` | `setBootstrapClasspath(FileCollection classpath)` {@inheritDoc}
    `JavaExec` | `setClasspath(FileCollection classpath)` {@inheritDoc}
    `void` | `setDebug(boolean enabled)` {@inheritDoc}
    `void` | `setDefaultCharacterEncoding(String defaultCharacterEncoding)` {@inheritDoc}
    `void` | `setEnableAssertions(boolean enabled)` {@inheritDoc}
    `void` | `setEnvironment(Map<String, ?> environmentVariables)` {@inheritDoc}
    `JavaExec` | `setErrorOutput(OutputStream outputStream)` {@inheritDoc}
    `void` | `setExecutable(Object executable)` {@inheritDoc}
    `JavaExecSpec` | `setIgnoreExitValue(boolean ignoreExitValue)` {@inheritDoc}
    `void` | `setJvmArgs(Iterable<?> arguments)` {@inheritDoc}
    `JavaExec` | `setMain(String mainClassName)` {@inheritDoc}
    `void` | `setMaxHeapSize(String heapSize)` {@inheritDoc}
    `void` | `setMinHeapSize(String heapSize)` {@inheritDoc}
    `JavaExec` | `setStandardInput(InputStream inputStream)` {@inheritDoc}
    `JavaExec` | `setStandardOutput(OutputStream outputStream)` {@inheritDoc}
    `void` | `setSystemProperties(Map<String, ?> properties)` {@inheritDoc}
    `void` | `setWorkingDir(Object dir)` {@inheritDoc}
    `JavaExec` | `systemProperties(Map<String, ?> properties)` {@inheritDoc}
    `JavaExec` | `systemProperty(String name, Object value)` {@inheritDoc}
    `JavaExec` | `workingDir(Object dir)` {@inheritDoc}

- - ### Constructor Detail

    - #### public JavaExec()

  - ### Method Detail

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

      {@inheritDoc}

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

      {@inheritDoc}

    - #### public JavaExec bootstrapClasspath(Object... classpath)

      {@inheritDoc}

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

      {@inheritDoc}

    - #### public JavaExec copyTo(JavaForkOptions options)

      {@inheritDoc}

    - #### public JavaExec copyTo(ProcessForkOptions target)

      {@inheritDoc}

    - #### public JavaExec environment(String name, Object value)

      {@inheritDoc}

    - #### public JavaExec environment(Map<String, ?> environmentVariables)

      {@inheritDoc}

    - #### @TaskAction public void exec()

    - #### public JavaExec executable(Object executable)

      {@inheritDoc}

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

      {@inheritDoc}

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

      {@inheritDoc}

    - #### @InputFiles public FileCollection getBootstrapClasspath()

      {@inheritDoc}

    - #### @InputFiles public FileCollection getClasspath()

      {@inheritDoc}

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

      {@inheritDoc}

    - #### public boolean getDebug()

      {@inheritDoc}

    - #### public String getDefaultCharacterEncoding()

      {@inheritDoc}

    - #### public boolean getEnableAssertions()

      {@inheritDoc}

    - #### public Map<String, Object> getEnvironment()

      {@inheritDoc}

    - #### public OutputStream getErrorOutput()

      {@inheritDoc}

    - #### public String getExecutable()

      {@inheritDoc}

    - #### @Inject protected FileResolver getFileResolver()

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

      {@inheritDoc}

    - #### public String getMain()

      {@inheritDoc}

    - #### public String getMaxHeapSize()

      {@inheritDoc}

    - #### public String getMinHeapSize()

      {@inheritDoc}

    - #### public InputStream getStandardInput()

      {@inheritDoc}

    - #### public OutputStream getStandardOutput()

      {@inheritDoc}

    - #### public Map<String, Object> getSystemProperties()

      {@inheritDoc}

    - #### public File getWorkingDir()

      {@inheritDoc}

    - #### public boolean isIgnoreExitValue()

      {@inheritDoc}

    - #### public JavaExec jvmArgs(Iterable<?> arguments)

      {@inheritDoc}

    - #### public JavaExec jvmArgs(Object... arguments)

      {@inheritDoc}

    - #### public void setAllJvmArgs(Iterable<?> arguments)

      {@inheritDoc}

    - #### public JavaExec setArgs(Iterable<?> applicationArgs)

      {@inheritDoc}

    - #### public void setBootstrapClasspath(FileCollection classpath)

      {@inheritDoc}

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

      {@inheritDoc}

    - #### @Option(option = "debug-jvm", description = "Enable debugging for the process. The process is started suspended and listening on port 5005. [INCUBATING]") public void setDebug(boolean enabled)

      {@inheritDoc}

    - #### public void setDefaultCharacterEncoding(String defaultCharacterEncoding)

      {@inheritDoc}

    - #### public void setEnableAssertions(boolean enabled)

      {@inheritDoc}

    - #### public void setEnvironment(Map<String, ?> environmentVariables)

      {@inheritDoc}

    - #### public JavaExec setErrorOutput(OutputStream outputStream)

      {@inheritDoc}

    - #### public void setExecutable(Object executable)

      {@inheritDoc}

    - #### public JavaExecSpec setIgnoreExitValue(boolean ignoreExitValue)

      {@inheritDoc}

    - #### public void setJvmArgs(Iterable<?> arguments)

      {@inheritDoc}

    - #### public JavaExec setMain(String mainClassName)

      {@inheritDoc}

    - #### public void setMaxHeapSize(String heapSize)

      {@inheritDoc}

    - #### public void setMinHeapSize(String heapSize)

      {@inheritDoc}

    - #### public JavaExec setStandardInput(InputStream inputStream)

      {@inheritDoc}

    - #### public JavaExec setStandardOutput(OutputStream outputStream)

      {@inheritDoc}

    - #### public void setSystemProperties(Map<String, ?> properties)

      {@inheritDoc}

    - #### public void setWorkingDir(Object dir)

      {@inheritDoc}

    - #### public JavaExec systemProperties(Map<String, ?> properties)

      {@inheritDoc}

    - #### public JavaExec systemProperty(String name, Object value)

      {@inheritDoc}

    - #### public JavaExec workingDir(Object dir)

      {@inheritDoc}