> This page is for SDKs, version Current (default).
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Java configuration

> Configuration options for the Java target in sdk-config.yml.

Configure the Java SDK in the `generation` block of its target in `sdk-config.yml`:

**`sdk-config.yml`**

```yaml {3-8} title="sdk-config.yml"
targets:
  - language: java
    generation:
      naming:
        clientName: YourClientName
      packageLayout: flat
      useLocalDateForDates: true
      collapseOptionalNullable: true
```

The target's `generation` block also accepts the [shared generation options](/learn/sdks/reference/sdk-config#generation), such as `naming`, `wireTests`, and `customCode`. Shared options set in the top-level `generation` block apply to every target, and a target's `generation` block overrides them. For `generators.yml` options, see the [Legacy Java configuration](/learn/sdks/legacy/generators/java/configuration).

## Java options

\<ParamField path="packageLayout" type=""flat" | "nested"" required= toc=>
Whether generated JVM packages use a flat or nested resource layout.
\</ParamField>

**`useLocalDateForDates`** `boolean`

Whether date-only values use LocalDate instead of OffsetDateTime.

---

**`collapseOptionalNullable`** `boolean`

Whether optional nullable values collapse into a single nullable representation.

---

**`gradleDistributionUrl`** `string`

The Gradle distribution URL written to the generated wrapper.

---

**`gradlePluginManagement`** `string`

Plugin management configuration added to the generated Gradle settings.

---

**`gradleCentralDependencyManagement`** `boolean`

Whether dependency versions are managed centrally in the Gradle project.

---

\<ParamField path="asyncStyle" type=""dedicated-client" | "twin-methods"" required= toc=>
Whether asynchronous operations use a separate client or co-located methods.
\</ParamField>

**`includeKotlinSnippets`** `boolean`

Whether Java SDK documentation includes Kotlin usage snippets.

---