# CompileOptions

API Documentation: | `CompileOptions`

Main options for Java compilation.

### Properties

Property | Description
`bootClasspath` | The bootstrap classpath to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.
`compiler` | Deprecated The compiler to be used. Only takes effect if `useAnt` is `true`.
`compilerArgs` | Returns any additional arguments to be passed to the compiler. Defaults to the empty list.
`debug` | Deprecated Deprecated.
`debugOptions` | Returns options for generating debugging information.
`dependOptions` | Returns options for using the Ant `<depend>` task.
`deprecation` | Tells whether to log details of usage of deprecated members or classes. Defaults to `false`.
`encoding` | The character encoding to be used when reading source files. Defaults to `null`, in which case the platform default encoding will be used.
`extensionDirs` | The extension dirs to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.
`failOnError` | Deprecated Deprecated.
`fork` | Tells whether to run the compiler in its own process. Note that this does not necessarily mean that a new process will be created for each compile task. Defaults to `false`.
`forkOptions` | Returns options for running the compiler in a child process.
`includeJavaRuntime` | Deprecated Tells whether the Java runtime should be put on the compile class path. Only takes effect if `useAnt` is `true`. Defaults to `false`.
`listFiles` | Tells whether to log the files to be compiled. Defaults to `false`.
`optimize` | Deprecated Tells whether to produce optimized byte code. Only takes effect if `useAnt` is `true`. Note that this flag is ignored by Sun's javac starting with JDK 1.3.
`useAnt` | Deprecated Tells whether to use the Ant javac task over Gradle's own Java compiler integration. Defaults to `false`.
`useDepend` | Tells whether to use the Ant `<depend>` task. Only takes effect if `useAnt` is `true`. Defaults to `false`.
`verbose` | Tells whether to produce verbose output. Defaults to `false`.
`warnings` | Tells whether to log warning messages. The default is `true`.

### Property details

#### `String` `bootClasspath`

The bootstrap classpath to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.

Default:
  `null`

#### `String` `compiler`

Note: This property is deprecated and will be removed in the next major version of Gradle.

The compiler to be used. Only takes effect if `useAnt` is `true`.

Default:
  `null`

#### ``List`<`String`>` `compilerArgs`

Returns any additional arguments to be passed to the compiler. Defaults to the empty list.

Default:
  `[]`

#### `boolean` `debug`

Note: This property is deprecated and will be removed in the next major version of Gradle.

Deprecated.

Default:
  `true`

#### `DebugOptions` `debugOptions`

Returns options for generating debugging information.

#### `DependOptions` `dependOptions`

Returns options for using the Ant `<depend>` task.

#### `boolean` `deprecation`

Tells whether to log details of usage of deprecated members or classes. Defaults to `false`.

Default:
  `false`

#### `String` `encoding`

The character encoding to be used when reading source files. Defaults to `null`, in which case the platform default encoding will be used.

Default:
  `null`

#### `String` `extensionDirs`

The extension dirs to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.

Default:
  `null`

#### `boolean` `failOnError`

Note: This property is deprecated and will be removed in the next major version of Gradle.

Deprecated.

Default:
  `true`

#### `boolean` `fork`

Tells whether to run the compiler in its own process. Note that this does not necessarily mean that a new process will be created for each compile task. Defaults to `false`.

Default:
  `false`

#### `ForkOptions` `forkOptions`

Returns options for running the compiler in a child process.

#### `boolean` `includeJavaRuntime`

Note: This property is deprecated and will be removed in the next major version of Gradle.

Tells whether the Java runtime should be put on the compile class path. Only takes effect if `useAnt` is `true`. Defaults to `false`.

Default:
  `false`

#### `boolean` `listFiles`

Tells whether to log the files to be compiled. Defaults to `false`.

Default:
  `false`

#### `boolean` `optimize`

Note: This property is deprecated and will be removed in the next major version of Gradle.

Tells whether to produce optimized byte code. Only takes effect if `useAnt` is `true`. Note that this flag is ignored by Sun's javac starting with JDK 1.3.

Default:
  `false`

#### `boolean` `useAnt`

Note: This property is deprecated and will be removed in the next major version of Gradle.

Tells whether to use the Ant javac task over Gradle's own Java compiler integration. Defaults to `false`.

Default:
  `false`

#### `boolean` `useDepend`

Tells whether to use the Ant `<depend>` task. Only takes effect if `useAnt` is `true`. Defaults to `false`.

Default:
  `false`

#### `boolean` `verbose`

Tells whether to produce verbose output. Defaults to `false`.

Default:
  `false`

#### `boolean` `warnings`

Tells whether to log warning messages. The default is `true`.

Default:
  `true`

### Script blocks

No script blocks

### Methods

Method | Description
`debug(debugArgs)` | Convenience method to set `DebugOptions` with named parameter syntax. Calling this method will set `debug` to `true`.
`depend(dependArgs)` | Convenience method to set `DependOptions` with named parameter syntax. Calling this method will set `useDepend` to `true`.
`fork(forkArgs)` | Convenience method to set `ForkOptions` with named parameter syntax. Calling this method will set `fork` to `true`.

### Method details

#### `CompileOptions` `debug`(``Map`<`String`, `Object`>` debugArgs)

Convenience method to set `DebugOptions` with named parameter syntax. Calling this method will set `debug` to `true`.

#### `CompileOptions` `depend`(``Map`<`String`, `Object`>` dependArgs)

Convenience method to set `DependOptions` with named parameter syntax. Calling this method will set `useDepend` to `true`.

#### `CompileOptions` `fork`(``Map`<`String`, `Object`>` forkArgs)

Convenience method to set `ForkOptions` with named parameter syntax. Calling this method will set `fork` to `true`.