A GitHub Action to set up a specific Java version and manage dependencies for Maven, Gradle, and sbt projects.
Setup Java is a GitHub Action that automates the installation and configuration of Java environments in CI/CD workflows. It downloads and sets up specified Java versions from various distributions, configures build tools like Maven and Gradle for publishing, and provides built-in dependency caching to optimize workflow performance.
Developers and teams building Java or Scala projects with GitHub Actions who need consistent, version-controlled Java environments and efficient dependency management in their CI/CD pipelines.
It eliminates manual JDK setup, ensures reproducible builds across runners, and significantly reduces build times through intelligent caching, making it the standard choice for Java projects on GitHub Actions.
Set up your GitHub Actions workflow with a specific version of Java
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports over 10 Java distributions including Temurin, Zulu, Corretto, and Oracle JDK, as listed in the supported distributions table, allowing teams to choose based on licensing or performance needs.
Automatically caches dependencies for Maven, Gradle, and sbt, with cache keys generated from dependency files, significantly reducing build times as described in the caching section.
Configures Maven and Gradle for publishing with authentication and GPG signing, and supports Maven Toolchains for projects using multiple JDK versions, streamlining artifact deployment.
Accepts exact versions, ranges, and early-access builds using SemVer notation, enabling precise environment control for testing and production workflows.
Exclusively designed for GitHub Actions, making it unsuitable for other CI/CD systems and creating vendor dependency for workflow portability.
For Gradle, the caching is rudimentary and lacks advanced features like configuration cache; the README explicitly recommends using a separate action for complex needs.
Major version updates, such as V5's switch to node24, can break existing workflows if runners aren't updated, requiring manual intervention and testing.