setup-java
Copilot instructions2k starsChanged 5 months agoMITView on GitHub
Use Node.js 24 or later (package.json declares >=24.0.0). This repository implements a Node.js GitHub Action. action.yml defines its inputs and outputs and runs dist/setup/index.js as the main entrypoint and dist/cleanup/index.js as the post-job entrypoint. The TypeScript sources in src/ are bundled with NCC; the committed dist/ files are what the action executes. The setup entrypoint parses inputs, resolves versions, and configures the action's shared features. src/distributions/distribution-factory.ts lazily selects a vendor installer. Vendor installers implement metadata lookup and archive handling on…
Trending
More talk lately.about the whole repository
Who's talking about actions/setup-java
- actions/runner“Workflow expression to read file content”GitHub · Jun 30, 2021 · 33 reactions
- apache/pinot“Extensible PinotDataBuffer SPI”GitHub · May 19, 2023 · 13 reactions
- adoptium/api.adoptium.net“Certificate has expired ”GitHub · Nov 12, 2021 · 13 reactions
- actions/cache“Provide a mechanism to have a per file cache eviction/retention”GitHub · Apr 14, 2022 · 12 reactions
- actions/toolkit“Cache upload does not handle 429 error”GitHub · Nov 30, 2023 · 6 reactions
The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 52
Talked about on GitHub and Bluesky (52 times).
On GitHub · 50
- Jun 30, 2021Workflow expression to read file content — actions/runner33 reactions · 2 comments
- May 19, 2023Extensible PinotDataBuffer SPI — apache/pinot13 reactions · 8 comments
- Nov 12, 2021Certificate has expired — adoptium/api.adoptium.net13 reactions · 3 comments
- Apr 14, 2022Provide a mechanism to have a per file cache eviction/retention — actions/cache12 reactions · 11 comments
- Nov 30, 2023Cache upload does not handle 429 error — actions/toolkit6 reactions · 4 comments
45 more on GitHub
- Sep 23, 2026chore(deps): bump the github-actions-minor-patch group across 1 directory with 4 updates — ROKT/rokt-sdk-flutter3 reactions · 2 comments
- Sep 16, 2026Bump actions/setup-java from 4.7.0 to 6.0.1 in /.github/actions/setup-java — ROKT/rokt-demo-android3 reactions · 6 comments
- Sep 16, 2026chore(deps): bump the github-actions-minor-patch group across 1 directory with 2 updates — ROKT/rokt-sdk-flutter3 reactions · 4 comments
- Sep 9, 2026Bump actions/setup-java from 4.7.0 to 6.0.0 in /.github/actions/setup-java — ROKT/rokt-demo-android3 reactions · 3 comments
- Sep 7, 2026chore(deps): bump actions/setup-java from 5.2.0 to 6.0.0 — ROKT/rokt-sdk-flutter3 reactions · 2 comments
- Jul 17, 2026chore(deps): bump actions/setup-java from 5.3.0 to 5.7.0 — KooshaPari/PhenoShared3 reactions · 5 comments
- Jul 10, 2026chore(deps): bump actions/setup-java from 5.3.0 to 5.5.0 — KooshaPari/PhenoShared3 reactions · 4 comments
- Jun 20, 2026chore(deps): bump actions/setup-java from 5.2.0 to 5.3.0 — KooshaPari/PhenoShared3 reactions · 4 comments
- Mar 24, 2026ci(deps): bump actions/setup-java from 4 to 5 — evilfps/bigbrightpaints-erp3 reactions · 4 comments
- Mar 24, 2026Bump actions/setup-java from 4 to 5 — Ven0m0/apk-tweak3 reactions · 2 comments
- Mar 17, 2026Bump actions/setup-java from 4.7.0 to 6.0.0 in /.github/actions/setup-java — ROKT/rokt-demo-android3 reactions · 5 comments
- Mar 13, 2021Push v1/v2 tags pointing to latest 1.x/2.x — serverless/github-action3 reactions · 1 comment
- Nov 9, 2026build(deps): bump actions/setup-java from 6.1.0 to 6.2.0 — DataDog/java-profiler2 reactions · 4 comments
- Sep 21, 2026Bump actions/setup-java from 4 to 6 — YudiOgusuko/Previsao_do_Tempo2 reactions · 1 comment
- Jun 3, 2026Bump actions/setup-java from 4 to 5 — veeeanti/botaccountswitcher2 reactions · 1 comment
- Nov 24, 2025Bump actions/setup-java from 4 to 5 — MyeoungDev/intellij-market-ticker2 reactions · 1 comment
- Nov 22, 2025Bump actions/setup-java from 4 to 5 — keanucz/logigit2 reactions · 2 comments
- Nov 16, 2025Bump actions/setup-java from 4 to 5 — freixas/gamma-language-support2 reactions · 1 comment
- Nov 10, 2025Bump actions/setup-java from 4 to 5 — verus/Earthly-IntelliJ-Plugin2 reactions · 1 comment
- Oct 31, 2025Bump actions/setup-java from 4 to 5 — folicore/ij-file-searcher-plugin2 reactions · 1 comment
- Oct 29, 2025Bump actions/setup-java from 4 to 5 — oyachi/shortcut-viewer2 reactions · 1 comment
- Oct 28, 2025Bump actions/setup-java from 4 to 5 — alepontes/world-cup-flags2 reactions · 1 comment
- Oct 24, 2025Bump actions/setup-java from 4 to 5 — kotlin-ru/rem-to-px2 reactions · 1 comment
- Oct 20, 2025Bump actions/setup-java from 4 to 5 — alexresiga/jetbrains-internship-application-workshop2 reactions · 1 comment
- Oct 15, 2025Bump actions/setup-java from 4 to 5 — chenlijun99/jetbrains-assignment2 reactions · 2 comments
- Oct 8, 2025Bump actions/setup-java from 4 to 5 — xygeni/intellij-plugin2 reactions · 1 comment
- Oct 5, 2025Bump actions/setup-java from 4 to 5 — AleksandrSl/lsp-playground2 reactions · 1 comment
- Oct 1, 2025Bump actions/setup-java from 4 to 5 — DavidSeptimus/maml-intellij-plugin2 reactions · 1 comment
- Sep 30, 2025Bump actions/setup-java from 4 to 5 — clement-hvt/phpstorm-prestashop-plugin2 reactions · 1 comment
- Sep 17, 2025Bump actions/setup-java from 4 to 5 — DrNerf/intellij-doom2 reactions · 1 comment
- Aug 31, 2025Bump actions/setup-java from 4 to 5 — prudhvir3ddy/JBINPB2 reactions · 1 comment
- Aug 30, 2025Bump actions/setup-java from 4 to 5 — shuryak/allure-go-run-plugin2 reactions · 1 comment
- Aug 30, 2025Bump actions/setup-java from 4 to 5 — NgJackin/knit-plugin2 reactions · 1 comment
- Aug 28, 2025Bump actions/setup-java from 4 to 5 — wafflescloud/coffeencode2 reactions · 1 comment
- Aug 27, 2025Bump actions/setup-java from 4 to 5 — rccccat/call-graph-for-java2 reactions · 1 comment
- Aug 23, 2025Bump actions/setup-java from 4 to 5 — nicwl/codex-cli-jetbrains-plugin2 reactions · 1 comment
- Aug 22, 2025Bump actions/setup-java from 4 to 5 — only52607/MyBatisSQLPreviewer2 reactions · 1 comment
- Aug 21, 2025Bump actions/setup-java from 4 to 5 — serzhby/doorman2 reactions · 1 comment
- Aug 21, 2025Bump actions/setup-java from 4 to 5 — kenowi-dev/watson2 reactions · 1 comment
- Nov 30, 2023Bump actions/setup-java from 3 to 4 — joao-pedro-braz/IntelliJAdonis2 reactions · 1 comment
- Nov 29, 2023build(deps): bump actions/setup-java from 3 to 4 — Fabiencdp/conotes-v22 reactions · 1 comment
- Nov 29, 2023Bump actions/setup-java from 3 to 4 — relentlessricktrinidad/fitted-intellij-plugin-direnv2 reactions · 1 comment
- Oct 21, 2021Renovate's GH Actions updates propose to delete YAML inline comments — renovatebot/renovate2 reactions · 3 comments
- Feb 13, 2021Github action for SapMachine — SAP/SapMachine2 reactions · 3 comments
- May 25, 2020Allow set up of settings.xml — stCarolas/setup-maven2 reactions · 3 comments
On Bluesky · 2
- Jun 22, 2026Productive day maintaining GitHub Action Setup Java GitHub.com/actions/setup-java — @brunoborges.bsky.social3 likes and reposts
- Jun 4, 2025Similar to Linux Kernel, OpenJDK Project is source-only project. The OpenJDK site deliberately avoids publishing binaries. The actual… — @shipilev.bsky.social1 likes and repost · 1 reply
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,349 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this copilot-instructions.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 5
Use Node.js 24 or later (package.json declares >=24.0.0).
- Very specific: line 26
Keep TypeScript source imports ESM-compatible: relative imports include the .js extension, even when the source file is .ts.
- Distinctive: line 28
When adding or changing distribution support, keep the distribution enum, factory, package-capability map, platform-capability map, README …
- Very specific: line 35
Treat action.yml inputs, outputs, defaults, and compatibility aliases as the public API.
- Distinctive: line 36
Do not assume version syntax, package variants, or platform/architecture support is uniform across distributions.
- Very specific: line 39
Treat dependency, wrapper, and JDK caches as distinct features with distinct keys and save behavior.
- Distinctive: line 41
Keep Maven credential inputs as environment-variable names, not secret values.
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot instructions
Build, test, and lint
Use Node.js 24 or later (package.json declares >=24.0.0).
npm ciinstalls the locked dependencies.npm testruns Jest serially with coverage.npm test -- --runTestsByPath __tests__/setup-java.test.tsruns one test file.npm test -- --runTestsByPath __tests__/setup-java.test.ts --testNamePattern="pattern"filters that file to matching test names.npm run lintruns ESLint on TypeScript files.npm run format-checkchecks Prettier formatting;npm run formatapplies it.npm run buildbundles the setup and post-job entrypoints intodist/.npm run checkruns format check, lint, build, and the full test suite.
Architecture
This repository implements a Node.js GitHub Action. action.yml defines its inputs and outputs and runs dist/setup/index.js as the main entrypoint and dist/cleanup/index.js as the post-job entrypoint. The TypeScript sources in src/ are bundled with NCC; the committed dist/ files are what the action executes.
The setup entrypoint parses inputs, resolves versions, and configures the action's shared features. src/distributions/distribution-factory.ts lazily selects a vendor installer. Vendor installers implement metadata lookup and archive handling on top of JavaBase in src/distributions/base-installer.ts, which centralizes version resolution, tool-cache/JDK-cache use, download verification, and Java environment setup. Package support and OS/architecture support are validated centrally in package-types.ts and platform-types.ts.
The setup flow also configures problem matchers, Maven authentication and arguments, and Maven toolchains. The post-job entrypoint removes any isolated GPG home and saves enabled caches when the job succeeds and cache saving is not read-only.
Repository-specific conventions
- Keep TypeScript source imports ESM-compatible: relative imports include the
.jsextension, even when the source file is.ts. - Distribution-specific download and metadata logic belongs in its installer under
src/distributions/; reuseJavaBaserather than duplicating common resolution, caching, verification, or environment behavior. - When adding or changing distribution support, keep the distribution enum, factory, package-capability map, platform-capability map, README support documentation, unit tests, and relevant end-to-end workflow coverage consistent.
- Unit tests live under
__tests__/and use Jest/ts-jest. Distribution tests are grouped under__tests__/distributors/; use the corresponding test and fixture patterns when changing an installer. End-to-end coverage is defined in.github/workflows/e2e-*.yml. - Rebuild and commit generated
dist/bundles for runtime-affecting source or dependency changes; do not make the bundles the source of truth.npm run checkincludes the build. - New npm dependencies need lockfile changes and corresponding license records under
.licenses/, following.licensed.ymland the licensed workflow.
Action behavior principles
- Treat
action.ymlinputs, outputs, defaults, and compatibility aliases as the public API. Keep implementation, README, and advanced-usage documentation aligned when behavior changes; preserve deprecated aliases unless a documented breaking change removes them. - Do not assume version syntax, package variants, or platform/architecture support is uniform across distributions. Keep capability checks and vendor resolution behavior consistent with the documented support matrix.
latestmeans the newest stable GA release, not an early-access build. - Preserve selection semantics: a recognized vendor in a supported version file may supply the distribution; otherwise the caller must provide it. If both
java-versionandjava-version-fileare given, the explicitjava-versiontakes precedence. - Preserve install-state behavior for multiple JDKs. The last installed JDK becomes the default unless
set-default: false; all installed JDKs remain available through their version-specific environment variables and Maven toolchains. Toolchain entries accumulate non-destructively, and custom IDs must correspond one-for-one with requested versions. - Treat dependency, wrapper, and JDK caches as distinct features with distinct keys and save behavior.
cacheenables dependency caching and implicitly enables JDK caching unlesscache-jdkoverrides it;cache-read-onlyrestores without saving. Keep changes to cache identity or lifecycle aligned with these documented contracts. - Preserve download-integrity guarantees: verify authoritative checksums when published. Signature verification is distribution-specific; explicit
verify-signature: truemust enforce verification where supported and fail clearly where unsupported. Do not silently weaken verification or imply that a cached install was downloaded and reverified. - Keep Maven credential inputs as environment-variable names, not secret values. Generated settings and custom repository behavior must respect the documented overwrite option, while toolchain merging remains non-destructive and independent of that option.
See docs/CONTRIBUTING.md for contribution and validation guidance, README.md for the public contract, and docs/advanced-usage.md for detailed behavior and examples.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

