From 8d6a81aeae1dd4eac7f2166d7fbc23e6a619332f Mon Sep 17 00:00:00 2001 From: Bruno Borges Date: Tue, 23 Jun 2026 13:05:51 -0400 Subject: [PATCH 1/3] docs: note jdkfile approach for Early Access / unreleased JDK builds Clarify in advanced-usage that the existing 'jdkfile' distribution can be used to install Early Access (EA) or other unreleased JDK builds not provided directly by setup-java, by downloading the archive in a prior step and pointing jdkFile at it. Adds a concrete EA example. Addresses #612. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/advanced-usage.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index f4838b349..c2874e5e3 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -270,6 +270,9 @@ steps: ## Installing Java from local file If your use-case requires a custom distribution or a version that is not provided by setup-java, you can download it manually and setup-java will take care of the installation and caching on the VM: +> [!NOTE] +> This approach also lets you use builds that setup-java does not provide directly, such as **Early Access (EA)** or other unreleased JDK builds (for example, an upcoming feature release or a loom/valhalla preview build). Download the desired archive in a prior step and point `jdkFile` at it; setup-java will extract, install, and cache it just like a supported distribution. When targeting multiple architectures, select the correct binary per architecture in your workflow (for example, with a build matrix). + ```yaml steps: - run: | @@ -285,6 +288,23 @@ steps: - run: java --version ``` +For example, to use an **Early Access** build (such as an upcoming feature release from [jdk.java.net](https://jdk.java.net/)) that is not yet available through a regular distribution: + +```yaml +steps: +- run: | + download_url="https://download.java.net/java/early_access/jdk25/36/GPL/openjdk-25-ea+36_linux-x64_bin.tar.gz" + wget -O $RUNNER_TEMP/java_package.tar.gz $download_url +- uses: actions/setup-java@v5 + with: + distribution: 'jdkfile' + jdkFile: ${{ runner.temp }}/java_package.tar.gz + java-version: '25-ea' + architecture: x64 + +- run: java --version +``` + If your use-case requires a custom distribution (in the example, alpine-linux is used) or a version that is not provided by setup-java and you want to always install the latest version during runtime, then you can use the following code to auto-download the latest JDK, determine the semver needed for setup-java, and setup-java will take care of the installation and caching on the VM: ```yaml From 9c56b2179ea3e25514e5b60eba71e62e9c28dbd9 Mon Sep 17 00:00:00 2001 From: Bruno Borges Date: Tue, 23 Jun 2026 13:17:31 -0400 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/advanced-usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index c2874e5e3..963bc38ba 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -288,7 +288,7 @@ steps: - run: java --version ``` -For example, to use an **Early Access** build (such as an upcoming feature release from [jdk.java.net](https://jdk.java.net/)) that is not yet available through a regular distribution: +For example, to use an **Early Access** build from [jdk.java.net](https://jdk.java.net/), download the archive for your runner OS/architecture and install it via `distribution: 'jdkfile'` (example below assumes Linux x64): ```yaml steps: From 8d619664620836e98e18eb4be9332eb254ffb387 Mon Sep 17 00:00:00 2001 From: Bruno Borges Date: Tue, 23 Jun 2026 13:22:31 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/advanced-usage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 963bc38ba..7de8ed702 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -271,7 +271,7 @@ steps: If your use-case requires a custom distribution or a version that is not provided by setup-java, you can download it manually and setup-java will take care of the installation and caching on the VM: > [!NOTE] -> This approach also lets you use builds that setup-java does not provide directly, such as **Early Access (EA)** or other unreleased JDK builds (for example, an upcoming feature release or a loom/valhalla preview build). Download the desired archive in a prior step and point `jdkFile` at it; setup-java will extract, install, and cache it just like a supported distribution. When targeting multiple architectures, select the correct binary per architecture in your workflow (for example, with a build matrix). +> This approach also lets you use builds that setup-java does not provide directly, such as **Early Access (EA)** or other unreleased JDK builds (for example, an upcoming feature release or a Loom/Valhalla preview build). Download the desired archive in a prior step and point `jdkFile` at it; setup-java will extract, install, and cache it just like a supported distribution. When targeting multiple architectures, select the correct binary per architecture in your workflow (for example, with a build matrix). ```yaml steps: @@ -299,7 +299,7 @@ steps: with: distribution: 'jdkfile' jdkFile: ${{ runner.temp }}/java_package.tar.gz - java-version: '25-ea' + java-version: '25.0.0-ea.36' architecture: x64 - run: java --version