Skip to content

Commit dfa3adf

Browse files
authored
Update advanced-usage.md
1 parent ecd2bf1 commit dfa3adf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/advanced-usage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,14 @@ steps:
168168
- run: java -cp java HelloWorldApp
169169
```
170170

171-
If your use-case reuires a custom distribution or a version that is not provided by setup-java and always install the latest version during runtime, then you can use below code to auto download the latest JDK, determine the semver needed for the setup-java and setup-java will take care of the installation and caching on the VM:
171+
If your use-case reuires a custom distribution (in the example alpine-linux is used) or a version that is not provided by setup-java and always install the latest version during runtime, then you can use below code to auto download the latest JDK, determine the semver needed for the setup-java and setup-java will take care of the installation and caching on the VM:
172172

173173
```yaml
174174
steps:
175175
- name: fetch latest temurin JDK
176176
id: fetch_latest_jdk
177177
run: |
178+
major_version={{ env.JAVA_VERSION }} # Example 8 or 11 or 17
178179
cd $RUNNER_TEMP
179180
response=$(curl -s "https://api.github.com/repos/adoptium/temurin${major_version}-binaries/releases")
180181
latest_jdk_download_url=$(echo "$response" | jq -r '.[0].assets[] | select(.name | contains("jdk_x64_alpine-linux") and endswith(".tar.gz")) | .browser_download_url')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy