# JavaApplication

interface JavaApplication(source)

Configuration for a Java application, defining how to assemble the application.

An instance of this type is added as a project extension by the Java application plugin under the name 'application'.

    plugins {
        id 'application'
    }

    application {
      mainClass.set("com.foo.bar.FooBar")
    }

Content copied to clipboard

#### Since

4.10

## Functions

getApplicationDefaultJvmArgs
Link copied to clipboard
abstract fun getApplicationDefaultJvmArgs(): Iterable<String>
Array of string arguments to pass to the JVM when running the application
getApplicationDistribution
Link copied to clipboard
abstract fun getApplicationDistribution(): CopySpec
The specification of the contents of the distribution.
getApplicationName
Link copied to clipboard
abstract fun getApplicationName(): String
The name of the application.
getExecutableDir
Link copied to clipboard
abstract fun getExecutableDir(): String
Directory to place executables in
getMainClass
Link copied to clipboard
abstract fun getMainClass(): Property<String>
The fully qualified name of the application's main class.
getMainModule
Link copied to clipboard
abstract fun getMainModule(): Property<String>
The name of the application's Java module if it should run as a module.
setApplicationDefaultJvmArgs
Link copied to clipboard
abstract fun setApplicationDefaultJvmArgs(applicationDefaultJvmArgs: Iterable<String>)
Array of string arguments to pass to the JVM when running the application
setApplicationDistribution
Link copied to clipboard
abstract fun setApplicationDistribution(applicationDistribution: CopySpec)
Sets the application distribution.
setApplicationName
Link copied to clipboard
abstract fun setApplicationName(applicationName: String)
The name of the application.
setExecutableDir
Link copied to clipboard
abstract fun setExecutableDir(executableDir: String)
Directory to place executables in