You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dd06d9c
Browse filesBrowse the repository at this point in the historyBrowse files
Update public examples and release messaging to make v6 the recommended stable version, include late-cycle v6 features, and increase the JetBrains test timeout to avoid cold-run flakes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 24e3d384-3bda-4ca3-b1fc-f49e340c174f
Copy file name to clipboardExpand all lines: README.md
+21-29Lines changed: 21 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,13 @@ Set up Java for GitHub Actions workflows. `setup-java` installs a requested Java
9
9
```yaml
10
10
steps:
11
11
- uses: actions/checkout@v7
12
-
- uses: actions/setup-java@v5
12
+
- uses: actions/setup-java@v6
13
13
with:
14
14
distribution: temurin
15
15
java-version: '25'
16
16
- run: java --version
17
17
```
18
18
19
-
> [!NOTE]
20
-
> V6 is still in development on the `main` branch and is not yet recommended for production workflows. To use it, you must explicitly reference the `main` branch in your workflow, as in
21
-
>
22
-
> ```yaml
23
-
> - uses: actions/setup-java@main
24
-
> ```
25
-
>
26
-
> For production workflows, it is recommended to use the latest stable release `v5`.
27
-
28
19
## Contents
29
20
30
21
- [What it does](#what-it-does)
@@ -54,15 +45,16 @@ steps:
54
45
55
46
## What's new
56
47
57
-
### V6 (in development)
48
+
### V6
58
49
59
50
- Migrated the action implementation to ESM to support the latest `@actions/*` packages.
60
-
- Added the `oracle-openjdk` distribution for OpenJDK builds from Oracle.
51
+
- Added the `oracle-openjdk`, `redhat`, and `liberica-nik` distributions.
61
52
- Added `java-version: latest` to resolve the newest stable GA release from the distribution's remote metadata.
62
-
- JDK downloads now automatically verify authoritative checksumsfor [supported distributions](#download-integrity-and-signatures).
53
+
- JDK downloads now automatically verify authoritative checksums, and package signature verification defaults to enabled for Temurin and Microsoft builds.
63
54
- Added `force-download: true` to bypass the tool cache and perform a reproducible fresh install.
64
55
- Dependency caching now supports custom paths with `cache-path` and restore-only operation with `cache-read-only: true`.
65
56
- Downloaded JDKs are now [cached](#caching-jdk-installations) automatically when `cache` is set; use `cache-jdk` to enable or disable it independently.
57
+
- Maven configuration now supports multiple server credentials and custom dependency-resolution repositories.
66
58
- Set `problem-matcher: false` to disable Java compiler and uncaught-exception annotations.
67
59
- GraalVM distributions now set `GRAALVM_HOME` in addition to `JAVA_HOME`.
68
60
- Invalid boolean values, unsupported distribution/package/platform combinations, and mismatched Maven toolchain ID counts now fail with targeted errors.
@@ -89,7 +81,7 @@ steps:
89
81
### Older versions
90
82
91
83
> [!WARNING]
92
-
> `actions/setup-java` versions `v1` through `v4` are deprecated. Upgrade workflows to `actions/setup-java@v5`, the latest stable release.
84
+
> `actions/setup-java` versions `v1` through `v4` are deprecated. Upgrade workflows to `actions/setup-java@v6`, the latest stable release.
93
85
94
86
## Usage
95
87
@@ -98,7 +90,7 @@ steps:
98
90
```yaml
99
91
steps:
100
92
- uses: actions/checkout@v7
101
-
- uses: actions/setup-java@v5
93
+
- uses: actions/setup-java@v6
102
94
with:
103
95
distribution: temurin
104
96
java-version: '25'
@@ -110,7 +102,7 @@ steps:
110
102
```yaml
111
103
steps:
112
104
- uses: actions/checkout@v7
113
-
- uses: actions/setup-java@v5
105
+
- uses: actions/setup-java@v6
114
106
with:
115
107
distribution: microsoft
116
108
java-version: '25'
@@ -122,7 +114,7 @@ steps:
122
114
```yaml
123
115
steps:
124
116
- uses: actions/checkout@v7
125
-
- uses: actions/setup-java@v5
117
+
- uses: actions/setup-java@v6
126
118
with:
127
119
distribution: temurin
128
120
java-version-file: .java-version
@@ -136,7 +128,7 @@ Supported version files are `.java-version`, `.tool-versions`, and `.sdkmanrc`.
136
128
```yaml
137
129
steps:
138
130
- uses: actions/checkout@v7
139
-
- uses: actions/setup-java@v5
131
+
- uses: actions/setup-java@v6
140
132
with:
141
133
distribution: temurin
142
134
java-version: latest
@@ -267,7 +259,7 @@ Set `cache` to `maven`, `gradle`, or `sbt` to cache dependencies with minimal co
267
259
```yaml
268
260
steps:
269
261
- uses: actions/checkout@v7
270
-
- uses: actions/setup-java@v5
262
+
- uses: actions/setup-java@v6
271
263
with:
272
264
distribution: temurin
273
265
java-version: '25'
@@ -286,7 +278,7 @@ The primary dependency cache key is `setup-java-<runner-os>-<node-arch>-<package
286
278
Use `cache-dependency-path` to override the files used for key hashing, especially in monorepos:
287
279
288
280
```yaml
289
-
- uses: actions/setup-java@v5
281
+
- uses: actions/setup-java@v6
290
282
with:
291
283
distribution: temurin
292
284
java-version: '25'
@@ -299,7 +291,7 @@ Use `cache-dependency-path` to override the files used for key hashing, especial
299
291
Use `cache-path` when the build tool stores dependencies outside the default location:
300
292
301
293
```yaml
302
-
- uses: actions/setup-java@v5
294
+
- uses: actions/setup-java@v6
303
295
with:
304
296
distribution: temurin
305
297
java-version: '25'
@@ -338,7 +330,7 @@ The JDK cache stores the downloaded JDK installation so later runs skip the down
338
330
Set `cache-read-only: true` to restore dependency, wrapper, and JDK caches without saving changes in the post action. This is useful for pull requests, merge queues, short-lived branches, and matrix fan-out jobs that should only consume caches produced elsewhere.
339
331
340
332
```yaml
341
-
- uses: actions/setup-java@v5
333
+
- uses: actions/setup-java@v6
342
334
with:
343
335
distribution: temurin
344
336
java-version: '25'
@@ -354,7 +346,7 @@ jobs:
354
346
runs-on: ubuntu-latest
355
347
steps:
356
348
- uses: actions/checkout@v7
357
-
- uses: actions/setup-java@v5
349
+
- uses: actions/setup-java@v6
358
350
with:
359
351
distribution: temurin
360
352
java-version: '25'
@@ -369,7 +361,7 @@ jobs:
369
361
goal: [test, verify, package]
370
362
steps:
371
363
- uses: actions/checkout@v7
372
-
- uses: actions/setup-java@v5
364
+
- uses: actions/setup-java@v6
373
365
with:
374
366
distribution: temurin
375
367
java-version: '25'
@@ -387,7 +379,7 @@ env:
387
379
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
388
380
steps:
389
381
- uses: actions/checkout@v7
390
-
- uses: actions/setup-java@v5
382
+
- uses: actions/setup-java@v6
391
383
with:
392
384
distribution: temurin
393
385
java-version: '25'
@@ -401,7 +393,7 @@ Install multiple Java versions by providing a multiline `java-version` value. Al
401
393
402
394
```yaml
403
395
steps:
404
-
- uses: actions/setup-java@v5
396
+
- uses: actions/setup-java@v6
405
397
with:
406
398
distribution: temurin
407
399
java-version: |
@@ -428,7 +420,7 @@ jobs:
428
420
name: Java ${{ matrix.java }}
429
421
steps:
430
422
- uses: actions/checkout@v7
431
-
- uses: actions/setup-java@v5
423
+
- uses: actions/setup-java@v6
432
424
with:
433
425
distribution: temurin
434
426
java-version: ${{ matrix.java }}
@@ -445,7 +437,7 @@ jobs:
445
437
```yaml
446
438
steps:
447
439
- uses: actions/checkout@v7
448
-
- uses: actions/setup-java@v5
440
+
- uses: actions/setup-java@v6
449
441
with:
450
442
distribution: temurin
451
443
java-version: '25'
@@ -467,7 +459,7 @@ required. See [Resolving Maven dependencies from custom repositories](docs/advan
> `oracle-openjdk`, and the `*-env-var` input names), reference
48
-
> `actions/setup-java@main`. For production workflows use the latest stable
49
-
> release, `actions/setup-java@v5`, as shown in the [README](../README.md).
50
-
51
42
## Selecting a Java distribution
52
43
`java-version` and `distribution` select what gets installed. `java-version` may be replaced by `java-version-file`, and `distribution` is optional only when `java-version-file` points to a `.sdkmanrc` or `.tool-versions` file that carries a recognized vendor identifier. In every other case both inputs must be provided. See [Supported distributions](../README.md#Supported-distributions) for a list of available options.
0 commit comments