ForkOptions (Gradle API 8.11.1)

Package 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.ProviderAwareCompilerDaemonForkOptions
      - - org.gradle.api.tasks.compile.ForkOptions

- All Implemented Interfaces:
    `java.io.Serializable`

      public abstract class ForkOptions
      extends ProviderAwareCompilerDaemonForkOptions

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

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ForkOptions()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getExecutable()` | Returns the compiler executable to be used.
    `java.io.File` | `getJavaHome()` | Deprecated.
    `java.lang.String` | `getTempDir()` | Returns the directory used for temporary files that may be created to pass command line arguments to the compiler process.
    `void` | `setExecutable​(java.lang.String executable)` | Sets the compiler executable to be used.
    `void` | `setJavaHome​(java.io.File javaHome)` | Deprecated.
    `void` | `setTempDir​(java.lang.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.ProviderAwareCompilerDaemonForkOptions

      `getAllJvmArgs, getJvmArgumentProviders`

    - ### 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`

    - ### 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

          @Nullable
          @Optional
          @Input
          public java.lang.String getExecutable()

      Returns the compiler executable to be used.

      Only takes effect if `CompileOptions.fork` is `true`. Defaults to `null`.

      Setting the executable disables task output caching.

    - #### setExecutable

          public void setExecutable​(@Nullable
                                    java.lang.String executable)

      Sets the compiler executable to be used.

      Only takes effect if `CompileOptions.fork` is `true`. Defaults to `null`.

      Setting the executable disables task output caching.

    - #### getJavaHome

          @Deprecated
          @Internal
          @Nullable
          public java.io.File getJavaHome()

      Deprecated.
      Returns the Java home which contains the compiler to use.

      Only takes effect if `CompileOptions.fork` is `true`. Defaults to `null`.

      Since:
        3.5

    - #### setJavaHome

          @Deprecated
          public void setJavaHome​(@Nullable
                                  java.io.File javaHome)

      Deprecated.
      Sets the Java home which contains the compiler to use.

      Only takes effect if `CompileOptions.fork` is `true`. Defaults to `null`.

      Since:
        3.5

    - #### getTempDir

          @Internal
          @Nullable
          public java.lang.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​(@Nullable
                                 java.lang.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.