# Interface JavaApplication

public interface JavaApplication
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")
    }

Since:
  4.10

- ## Method Summary

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

- ## Method Details

  - ### getApplicationName

    String getApplicationName()
    The name of the application.
    Since:
      4.10

  - ### setApplicationName

    void setApplicationName(String applicationName)
    The name of the application.
    Since:
      4.10

  - ### getMainModule

    Property<String> getMainModule()
    The name of the application's Java module if it should run as a module.
    Since:
      6.4

  - ### getMainClass

    Property<String> getMainClass()
    The fully qualified name of the application's main class.
    Since:
      6.4

  - ### getApplicationDefaultJvmArgs

    Iterable<String> getApplicationDefaultJvmArgs()
    Array of string arguments to pass to the JVM when running the application
    Since:
      4.10

  - ### setApplicationDefaultJvmArgs

    void setApplicationDefaultJvmArgs(Iterable<String> applicationDefaultJvmArgs)
    Array of string arguments to pass to the JVM when running the application
    Since:
      4.10

  - ### getExecutableDir

    String getExecutableDir()
    Directory to place executables in
    Since:
      4.10

  - ### setExecutableDir

    void setExecutableDir(String executableDir)
    Directory to place executables in
    Since:
      4.10

  - ### getApplicationDistribution

    CopySpec getApplicationDistribution()

    The specification of the contents of the distribution.

    Use this `CopySpec` to include extra files/resource in the application distribution.

        plugins {
            id 'application'
        }

        application {
            applicationDistribution.from("some/dir") {
                include "*.txt"
            }
        }

    Note that the application plugin pre configures this spec to; include the contents of "`src/dist`", copy the application start scripts into the "`bin`" directory, and copy the built jar and its dependencies into the "`lib`" directory.

    Since:
      4.10

  - ### setApplicationDistribution

    void setApplicationDistribution(CopySpec applicationDistribution)
    Sets the application distribution.
    Since:
      4.10