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
Copy file name to clipboardExpand all lines: README.md
+27-18Lines changed: 27 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,20 @@ The `setup-java` action provides the following functionality for GitHub Actions
18
18
19
19
This action allows you to work with Java and Scala projects.
20
20
21
+
## Breaking changes in V5
22
+
23
+
- Upgraded action from node20 to node24
24
+
> Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
25
+
26
+
For more details, see the full release notes on the [releases page](https://github.com/actions/setup-java/releases/tag/v5.0.0)
27
+
21
28
## V2 vs V1
22
29
23
30
- V2 supports custom distributions and provides support for Azul Zulu OpenJDK, Eclipse Temurin and AdoptOpenJDK out of the box. V1 supports only Azul Zulu OpenJDK.
24
31
- V2 requires you to specify distribution along with the version. V1 defaults to Azul Zulu OpenJDK, only version input is required. Follow [the migration guide](docs/switching-to-v2.md) to switch from V1 to V2.
25
32
33
+
For information about the latest releases, recent updates, and newly supported distributions, please refer to the `setup-java`[Releases](https://github.com/actions/setup-java/releases).
34
+
26
35
## Usage
27
36
28
37
-`java-version`: The Java version that is going to be set up. Takes a whole or [semver](#supported-version-syntax) Java version. If not specified, the action will expect `java-version-file` input to be specified.
@@ -75,8 +84,8 @@ This action allows you to work with Java and Scala projects.
75
84
#### Eclipse Temurin
76
85
```yaml
77
86
steps:
78
-
- uses: actions/checkout@v4
79
-
- uses: actions/setup-java@v4
87
+
- uses: actions/checkout@v5
88
+
- uses: actions/setup-java@v5
80
89
with:
81
90
distribution: 'temurin'# See 'Supported distributions' for available options
82
91
java-version: '21'
@@ -86,8 +95,8 @@ steps:
86
95
#### Azul Zulu OpenJDK
87
96
```yaml
88
97
steps:
89
-
- uses: actions/checkout@v4
90
-
- uses: actions/setup-java@v4
98
+
- uses: actions/checkout@v5
99
+
- uses: actions/setup-java@v5
91
100
with:
92
101
distribution: 'zulu'# See 'Supported distributions' for available options
93
102
java-version: '21'
@@ -142,8 +151,8 @@ The cache input is optional, and caching is turned off by default.
142
151
#### Caching gradle dependencies
143
152
```yaml
144
153
steps:
145
-
- uses: actions/checkout@v4
146
-
- uses: actions/setup-java@v4
154
+
- uses: actions/checkout@v5
155
+
- uses: actions/setup-java@v5
147
156
with:
148
157
distribution: 'temurin'
149
158
java-version: '21'
@@ -157,8 +166,8 @@ steps:
157
166
#### Caching maven dependencies
158
167
```yaml
159
168
steps:
160
-
- uses: actions/checkout@v4
161
-
- uses: actions/setup-java@v4
169
+
- uses: actions/checkout@v5
170
+
- uses: actions/setup-java@v5
162
171
with:
163
172
distribution: 'temurin'
164
173
java-version: '21'
@@ -171,8 +180,8 @@ steps:
171
180
#### Caching sbt dependencies
172
181
```yaml
173
182
steps:
174
-
- uses: actions/checkout@v4
175
-
- uses: actions/setup-java@v4
183
+
- uses: actions/checkout@v5
184
+
- uses: actions/setup-java@v5
176
185
with:
177
186
distribution: 'temurin'
178
187
java-version: '21'
@@ -191,8 +200,8 @@ Usually, cache gets downloaded in multiple segments of fixed sizes. Sometimes, a
191
200
env:
192
201
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
193
202
steps:
194
-
- uses: actions/checkout@v4
195
-
- uses: actions/setup-java@v4
203
+
- uses: actions/checkout@v5
204
+
- uses: actions/setup-java@v5
196
205
with:
197
206
distribution: 'temurin'
198
207
java-version: '21'
@@ -211,8 +220,8 @@ For Java distributions that are not cached on Hosted images, `check-latest` alwa
211
220
212
221
```yaml
213
222
steps:
214
-
- uses: actions/checkout@v4
215
-
- uses: actions/setup-java@v4
223
+
- uses: actions/checkout@v5
224
+
- uses: actions/setup-java@v5
216
225
with:
217
226
distribution: 'temurin'
218
227
java-version: '21'
@@ -230,9 +239,9 @@ jobs:
230
239
java: [ '8', '11', '17', '21' ]
231
240
name: Java ${{ matrix.Java }} sample
232
241
steps:
233
-
- uses: actions/checkout@v4
242
+
- uses: actions/checkout@v5
234
243
- name: Setup java
235
-
uses: actions/setup-java@v4
244
+
uses: actions/setup-java@v5
236
245
with:
237
246
distribution: '<distribution>'
238
247
java-version: ${{ matrix.java }}
@@ -241,11 +250,11 @@ jobs:
241
250
242
251
### Install multiple JDKs
243
252
244
-
By default all versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'.
253
+
All configured Java versions are added to the PATH. The last one added to the PATH (i.e., the last JDK set up by this action) will be used as the default and available globally. Other Java versions can be accessed through environment variables such as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'. To use a specific Java version, set the JAVA_HOME environment variable accordingly and prepend its bin directory to the PATH to ensure it takes priority during execution.
0 commit comments