# JavaExecSpec

interface JavaExecSpec : JavaForkOptions, BaseExecSpec(source)

Specifies the options for executing a Java application.

#### Inheritors

JavaExec

## Functions

args
Link copied to clipboard
abstract fun args(args: Iterable<out Any>): JavaExecSpec
abstract fun args(args: Array<Any>): JavaExecSpec
Adds args for the main class to be executed.
bootstrapClasspath
Link copied to clipboard
abstract fun bootstrapClasspath(@Nullable classpath: Array<@Nullable Any>): JavaForkOptions
Adds the given values to the end of the bootstrap classpath for the process.
classpath
Link copied to clipboard
abstract fun classpath(@Nullable paths: Array<@Nullable Any>): JavaExecSpec
Adds elements to the classpath for executing the main class.
copyTo
Link copied to clipboard
abstract fun copyTo(options: JavaForkOptions): JavaForkOptions
Copies these options to the given options.
abstract fun copyTo(options: ProcessForkOptions): ProcessForkOptions
Copies these options to the given target options.
debugOptions
Link copied to clipboard
abstract fun debugOptions(action: Action<JavaDebugOptions>)
Configures Java Debug Wire Protocol properties for the process.
environment
Link copied to clipboard
abstract fun environment(environmentVariables: Map<String, out Any>): ProcessForkOptions
Adds some environment variables to the environment for this process.
abstract fun environment(name: String, value: Any): ProcessForkOptions
Adds an environment variable to the environment for this process.
environment
Link copied to clipboard
inline fun ProcessForkOptions.environment(vararg environmentVariables: Pair<String, Any>): ProcessForkOptions

Kotlin extension function for org.gradle.process.ProcessForkOptions.environment.

executable
Link copied to clipboard
abstract fun executable(executable: Any): ProcessForkOptions
Sets the name of the executable to use.
getAllJvmArgs
Link copied to clipboard
@Internal
abstract fun getAllJvmArgs(): Provider<List<String>>
Returns the full set of arguments to use to launch the JVM for the process.
getArgs
Link copied to clipboard
@Optional
@Input
abstract fun getArgs(): ListProperty<String>
Returns the arguments passed to the main class to be executed.
getArgumentProviders
Link copied to clipboard
abstract fun getArgumentProviders(): ListProperty<CommandLineArgumentProvider>
Argument providers for the application.
getBootstrapClasspath
Link copied to clipboard
@Classpath
abstract fun getBootstrapClasspath(): ConfigurableFileCollection
Returns the bootstrap classpath to use for the process.
getClasspath
Link copied to clipboard
@Classpath
abstract fun getClasspath(): ConfigurableFileCollection
Returns the classpath for executing the main class.
getCommandLine
Link copied to clipboard
abstract fun getCommandLine(): Provider<List<String>>
Returns the full command line, including the executable plus its arguments.
getDebug
Link copied to clipboard
@Input
abstract fun getDebug(): Property<Boolean>
Determines whether debugging is enabled for the test process.
getDebugOptions
Link copied to clipboard
abstract fun getDebugOptions(): JavaDebugOptions
Returns the Java Debug Wire Protocol properties for the process.
getDefaultCharacterEncoding
Link copied to clipboard
@Optional
@Input
abstract fun getDefaultCharacterEncoding(): Property<String>
Returns the default character encoding to use.
getEnableAssertions
Link copied to clipboard
@Input
@Optional
abstract fun getEnableAssertions(): Property<Boolean>
A flag that marks if assertions are enabled for the process.
getEnvironment
Link copied to clipboard
abstract fun getEnvironment(): MapProperty<String, Any>
The environment variables to use for the process.
getErrorOutput
Link copied to clipboard
abstract fun getErrorOutput(): Property<OutputStream>
Returns the output stream to consume standard error from the process executing the command.
getExecutable
Link copied to clipboard
abstract fun getExecutable(): Property<String>
Returns the name of the executable to use.
getIgnoreExitValue
Link copied to clipboard
abstract fun getIgnoreExitValue(): Property<Boolean>
Tells whether a non-zero exit value is ignored, or an exception thrown.
getIsIgnoreExitValue
Link copied to clipboard
open fun getIsIgnoreExitValue(): Property<Boolean>
Added for Kotlin DSL source compatibility.
getJvmArgs
Link copied to clipboard
@Optional
@Input
abstract fun getJvmArgs(): ListProperty<String>
The extra arguments to use to launch the JVM for the process.
getJvmArgumentProviders
Link copied to clipboard
abstract fun getJvmArgumentProviders(): ListProperty<CommandLineArgumentProvider>
Command line argument providers for the java process to fork.
getJvmArguments
Link copied to clipboard
@Incubating
@Optional
@Internal
abstract fun getJvmArguments(): ListProperty<String>
Extra JVM arguments to be to use to launch the JVM for the process.
getMainClass
Link copied to clipboard
@Optional
@Input
abstract fun getMainClass(): Property<String>
The fully qualified name of the Main class to be executed.
getMainModule
Link copied to clipboard
@Optional
@Input
abstract fun getMainModule(): Property<String>
The name of the main module to be executed if the application should run as a Java module.
getMaxHeapSize
Link copied to clipboard
@Optional
@Input
abstract fun getMaxHeapSize(): Property<String>
Returns the maximum heap size for the process, if any.
getMinHeapSize
Link copied to clipboard
@Optional
@Input
abstract fun getMinHeapSize(): Property<String>
Returns the minimum heap size for the process, if any.
getModularity
Link copied to clipboard
abstract fun getModularity(): ModularitySpec
Returns the module path handling for executing the main class.
getStandardInput
Link copied to clipboard
abstract fun getStandardInput(): Property<InputStream>
Returns the standard input stream for the process executing the command.
getStandardOutput
Link copied to clipboard
abstract fun getStandardOutput(): Property<OutputStream>
Returns the output stream to consume standard output from the process executing the command.
getSystemProperties
Link copied to clipboard
@Input
abstract fun getSystemProperties(): MapProperty<String, Any>
System properties which will be used for the process.
getWorkingDir
Link copied to clipboard
abstract fun getWorkingDir(): DirectoryProperty
Returns the working directory for the process.
jvmArgs
Link copied to clipboard
abstract fun jvmArgs(arguments: Iterable<out Any>): JavaForkOptions
abstract fun jvmArgs(arguments: Array<Any>): JavaForkOptions
Adds some arguments to use to launch the JVM for the process.
setAllJvmArgs
Link copied to clipboard
abstract fun setAllJvmArgs(arguments: Iterable<out Any>)
abstract fun setAllJvmArgs(arguments: List<String>)
Sets the full set of arguments to use to launch the JVM for the process.
setArgs
Link copied to clipboard
abstract fun setArgs(args: Iterable<out Any>): JavaExecSpec
abstract fun setArgs(args: List<String>): JavaExecSpec
Sets the args for the main class to be executed.
setBootstrapClasspath
Link copied to clipboard
abstract fun setBootstrapClasspath(bootstrapClasspath: FileCollection)
Sets the bootstrap classpath to use for the process.
setClasspath
Link copied to clipboard
abstract fun setClasspath(classpath: FileCollection): JavaExecSpec
Sets the classpath for executing the main class.
setDebug
Link copied to clipboard
abstract fun setDebug(debug: Boolean)
Enable or disable debugging for the process.
setDefaultCharacterEncoding
Link copied to clipboard
abstract fun setDefaultCharacterEncoding(@Nullable defaultCharacterEncoding: @Nullable String)
Sets the default character encoding to use.
setEnableAssertions
Link copied to clipboard
abstract fun setEnableAssertions(enableAssertions: Boolean)
Enable or disable assertions for the process.
setEnvironment
Link copied to clipboard
abstract fun setEnvironment(environment: Map<String, out Any>)
Sets the environment variable to use for the process.
setEnvironment
Link copied to clipboard
inline fun ProcessForkOptions.setEnvironment(vararg environment: Pair<String, Any>)

Kotlin extension function for org.gradle.process.ProcessForkOptions.setEnvironment.

setErrorOutput
Link copied to clipboard
abstract fun setErrorOutput(errorOutput: OutputStream): BaseExecSpec
Sets the output stream to consume standard error from the process executing the command.
setExecutable
Link copied to clipboard
abstract fun setExecutable(executable: Any)
abstract fun setExecutable(executable: String)
Sets the name of the executable to use.
setIgnoreExitValue
Link copied to clipboard
abstract fun setIgnoreExitValue(ignoreExitValue: Boolean): BaseExecSpec
Sets whether a non-zero exit value is ignored, or an exception thrown.
setJvmArgs
Link copied to clipboard
abstract fun setJvmArgs(arguments: Iterable<out Any>)
abstract fun setJvmArgs(arguments: List<String>)
Sets the extra arguments to use to launch the JVM for the process.
setMaxHeapSize
Link copied to clipboard
abstract fun setMaxHeapSize(@Nullable maxHeapSize: @Nullable String)
Sets the maximum heap size for the process.
setMinHeapSize
Link copied to clipboard
abstract fun setMinHeapSize(@Nullable minHeapSize: @Nullable String)
Sets the minimum heap size for the process.
setStandardInput
Link copied to clipboard
abstract fun setStandardInput(standardInput: InputStream): BaseExecSpec
Sets the standard input stream for the process executing the command.
setStandardOutput
Link copied to clipboard
abstract fun setStandardOutput(standardOutput: OutputStream): BaseExecSpec
Sets the output stream to consume standard output from the process executing the command.
setSystemProperties
Link copied to clipboard
abstract fun setSystemProperties(systemProperties: Map<String, out @Nullable Any>)
Sets the system properties to use for the process.
setSystemProperties
Link copied to clipboard
inline fun JavaForkOptions.setSystemProperties(vararg systemProperties: Pair<String, Any>)

Kotlin extension function for org.gradle.process.JavaForkOptions.setSystemProperties.

setWorkingDir
Link copied to clipboard
abstract fun setWorkingDir(dir: File)
abstract fun setWorkingDir(dir: Any)
Sets the working directory for the process.
systemProperties
Link copied to clipboard
abstract fun systemProperties(properties: Map<String, out @Nullable Any>): JavaForkOptions
Adds some system properties to use for the process.
systemProperties
Link copied to clipboard
inline fun JavaForkOptions.systemProperties(vararg properties: Pair<String, Any>): JavaForkOptions

Kotlin extension function for org.gradle.process.JavaForkOptions.systemProperties.

systemProperty
Link copied to clipboard
abstract fun systemProperty(name: String, @Nullable value: @Nullable Any): JavaForkOptions
Adds a system property to use for the process.
workingDir
Link copied to clipboard
abstract fun workingDir(dir: Any): ProcessForkOptions
Sets the working directory for the process.