org.gradle.api.tasks.compile

## Class ForkOptions

- java.lang.Object
- - org.gradle.api.tasks.compile.AbstractOptions
  - - org.gradle.api.tasks.compile.BaseForkOptions
    - - org.gradle.api.tasks.compile.ForkOptions

- All Implemented Interfaces:
    Serializable

      public class ForkOptions
      extends BaseForkOptions

  Fork options for Java compilation. Only take effect if `CompileOptions.fork` is `true`.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ForkOptions()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `excludeFromAntProperties(String fieldName)`
    `String` | `getExecutable()` Deprecated. Use `getJavaHome()` instead
    `File` | `getJavaHome()` Returns the Java home which contains the compiler to use.
    `String` | `getTempDir()` Returns the directory used for temporary files that may be created to pass command line arguments to the compiler process.
    `void` | `setExecutable(String executable)` Deprecated. Use `setJavaHome(File)` instead
    `void` | `setJavaHome(File javaHome)` Sets the Java home which contains the compiler to use.
    `void` | `setTempDir(String tempDir)` Sets the directory used for temporary files that may be created to pass command line arguments to the compiler process.

    - ### Methods inherited from class org.gradle.api.tasks.compile.BaseForkOptions

      `getJvmArgs, getMemoryInitialSize, getMemoryMaximumSize, setJvmArgs, setMemoryInitialSize, setMemoryMaximumSize`

    - ### Methods inherited from class org.gradle.api.tasks.compile.AbstractOptions

      `define, getAntPropertyName, getAntPropertyValue, optionMap`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ForkOptions

          public ForkOptions()

  - ### Method Detail

    - #### getExecutable

          @Input
          @Optional
          @Deprecated
          public String getExecutable()

      Deprecated. Use `getJavaHome()` instead
      Returns the compiler executable to be used. If set, a new compiler process will be forked for every compile task. Defaults to `null`.

    - #### setExecutable

          @Deprecated
          public void setExecutable(String executable)

      Deprecated. Use `setJavaHome(File)` instead
      Sets the compiler executable to be used. If set, a new compiler process will be forked for every compile task. Defaults to `null`.

    - #### getJavaHome

          @Internal
          @Incubating
          public File getJavaHome()

      Returns the Java home which contains the compiler to use. If set, a new compiler process will be forked for every compile task. Defaults to `null`.
      Since:
        3.5

    - #### setJavaHome

          @Incubating
          public void setJavaHome(File javaHome)

      Sets the Java home which contains the compiler to use. If set, a new compiler process will be forked for every compile task. Defaults to `null`.
      Since:
        3.5

    - #### getTempDir

          @Internal
          public String getTempDir()

      Returns the directory used for temporary files that may be created to pass command line arguments to the compiler process. Defaults to `null`, in which case the directory will be chosen automatically.

    - #### setTempDir

          public void setTempDir(String tempDir)

      Sets the directory used for temporary files that may be created to pass command line arguments to the compiler process. Defaults to `null`, in which case the directory will be chosen automatically.

    - #### excludeFromAntProperties

          protected boolean excludeFromAntProperties(String fieldName)

      Overrides:
        `excludeFromAntProperties` in class `BaseForkOptions`